Package releases
This commit is contained in:
rodič
d5929e5fbb
revize
6327fa27e6
|
@ -1,37 +1,82 @@
|
||||||
name: Test, build, deploy
|
name: Test, build, deploy
|
||||||
|
env:
|
||||||
|
ENTRY: 23
|
||||||
|
GH_PAGES_DOMAIN: data.prgblockweek.com
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main # Set a branch to deploy
|
- main
|
||||||
pull_request:
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
concurrency:
|
outputs:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
tag: ${{ env.TAG }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup repo
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup Deno
|
- uses: denoland/setup-deno@v1
|
||||||
#uses: denoland/setup-deno@v1
|
|
||||||
uses: denoland/setup-deno@9db7f66e8e16b5699a514448ce994936c63f0d54
|
|
||||||
with:
|
with:
|
||||||
deno-version: v1.x
|
deno-version: v1.x
|
||||||
- uses: szenius/set-timezone@v1.0
|
- uses: szenius/set-timezone@v1.0
|
||||||
with:
|
with:
|
||||||
timezoneLinux: "Europe/Prague"
|
timezoneLinux: "Europe/Prague"
|
||||||
- name: Build sources
|
- run: make
|
||||||
run: make
|
- run: find dist
|
||||||
# - name: Build changelog
|
- run: "deno run --allow-run utils/tag.js >> $GITHUB_ENV"
|
||||||
# run: make changelog
|
- run: "echo \"${{ env.TAG }}\" >> ./dist/TAG"
|
||||||
- name: List ./dist
|
- run: "echo \"Builded Tag: ${{ env.TAG }}\""
|
||||||
run: find dist
|
- uses: montudor/action-zip@v1
|
||||||
- name: Add custom domain
|
- run: "zip -qq -r release.zip dist"
|
||||||
run: "touch dist/CNAME && echo \"data.prgblockweek.com\" >> dist/CNAME"
|
- uses: actions/upload-artifact@v3
|
||||||
- name: Deploy
|
with:
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
name: release
|
||||||
|
path: release.zip
|
||||||
|
release:
|
||||||
|
needs: [build]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- run: "echo \"TAG=${{ needs.build.outputs.tag }}\" >> $GITHUB_ENV"
|
||||||
|
- run: "echo \"Tag: ${{ env.TAG }}\""
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: release
|
||||||
|
- uses: montudor/action-zip@v1
|
||||||
|
- run: unzip -qq release.zip
|
||||||
|
- run: "zip -qq -r ../pbw-${{ env.ENTRY }}-${{ env.TAG }}.zip ${{ env.ENTRY }}"
|
||||||
|
working-directory: ./dist
|
||||||
|
- uses: rickstaa/action-create-tag@v1
|
||||||
|
with:
|
||||||
|
tag: "${{ env.TAG }}"
|
||||||
|
message: "Latest release"
|
||||||
|
github_token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
|
- uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
tag_name: "${{ env.TAG }}"
|
||||||
|
name: "${{ env.TAG }}"
|
||||||
|
body: "This is a automated release."
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
files: |
|
||||||
|
pbw-${{ env.ENTRY }}-${{ env.TAG }}.zip
|
||||||
|
pages:
|
||||||
|
needs: [build]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: release
|
||||||
|
- uses: montudor/action-zip@v1
|
||||||
|
- run: unzip -qq release.zip
|
||||||
|
- run: find dist
|
||||||
|
- run: "touch dist/CNAME && echo \"${{ env.GH_PAGES_DOMAIN }}\" >> dist/CNAME"
|
||||||
|
- uses: peaceiris/actions-gh-pages@v3
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: ./dist
|
publish_dir: ./dist
|
|
@ -2,3 +2,4 @@
|
||||||
dist
|
dist
|
||||||
dist-mirror
|
dist-mirror
|
||||||
cache
|
cache
|
||||||
|
.env
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
pipeline:
|
pipeline:
|
||||||
|
|
||||||
build_mirror:
|
build_mirror:
|
||||||
image: denoland/deno
|
image: denoland/deno
|
||||||
commands:
|
commands:
|
||||||
|
@ -7,11 +6,13 @@ pipeline:
|
||||||
- apt install make
|
- apt install make
|
||||||
- deno --version
|
- deno --version
|
||||||
- make mirror
|
- make mirror
|
||||||
|
when:
|
||||||
|
branch: [main]
|
||||||
deploy_mirror:
|
deploy_mirror:
|
||||||
image: rclone/rclone
|
image: rclone/rclone
|
||||||
commands:
|
commands:
|
||||||
- "rclone sync dist-mirror/ :sftp:data/ --sftp-host frontier.gwei.cz --sftp-user pbw-deploy --sftp-port 2022 --sftp-pass $RCLONE_PASS -v"
|
- "rclone sync dist-mirror/ :sftp:data/ --sftp-host frontier.gwei.cz --sftp-user pbw-deploy --sftp-port 2022 --sftp-pass $RCLONE_PASS -v"
|
||||||
secrets: [RCLONE_PASS]
|
secrets: [RCLONE_PASS]
|
||||||
when:
|
when:
|
||||||
branch: [main]
|
branch: [main]
|
||||||
|
branches: [main]
|
3
Makefile
3
Makefile
|
@ -23,3 +23,6 @@ build-mirror:
|
||||||
|
|
||||||
event-sync:
|
event-sync:
|
||||||
deno run --unstable --allow-read --allow-write --allow-net utils/eventSync.js $(event)
|
deno run --unstable --allow-read --allow-write --allow-net utils/eventSync.js $(event)
|
||||||
|
|
||||||
|
tag:
|
||||||
|
deno run --unstable --allow-run utils/tag.js
|
|
@ -10,7 +10,8 @@ to coordinate event listings.
|
||||||
- 💽 Data: [data.prgblockweek.com](https://data.prgblockweek.com)
|
- 💽 Data: [data.prgblockweek.com](https://data.prgblockweek.com)
|
||||||
- 🕵️ Explore: [explore.prgblockweek.com](https://explore.prgblockweek.com/)
|
- 🕵️ Explore: [explore.prgblockweek.com](https://explore.prgblockweek.com/)
|
||||||
|
|
||||||
You can use JSON Hero to view the data: [`/23/index.json` @ JSON Hero](https://jsonhero.io/new?url=https://data.prgblockweek.com/23/index.json)
|
You can use JSON Hero to view the data:
|
||||||
|
[`/23/index.json` @ JSON Hero](https://jsonhero.io/new?url=https://data.prgblockweek.com/23/index.json)
|
||||||
|
|
||||||
## Follow us!
|
## Follow us!
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
const d = new Date();
|
||||||
|
const tag = `v${d.getFullYear()}.${("0" + (d.getMonth() + 1)).slice(-2)}.${
|
||||||
|
("0" + d.getDate()).slice(-2)
|
||||||
|
}`;
|
||||||
|
const p = Deno.run({ cmd: ["git", "tag"], stdout: "piped" });
|
||||||
|
const current = String.fromCharCode.apply(null, await p.output()).trim();
|
||||||
|
const m = current.match(new RegExp(`${tag}`, "g"));
|
||||||
|
const num = m ? m.length : 0;
|
||||||
|
console.log(`TAG=${tag}-r${num}`);
|
Načítá se…
Odkázat v novém úkolu