|
| 1 | +name: cd·vx |
| 2 | + |
1 | 3 | on: |
2 | | - push: |
3 | | - branches: main |
4 | | - paths: |
5 | | - - .github/workflows/deploy.yml |
6 | | - - .github/scripts/* |
7 | | - - scripts/* |
8 | | - pull_request: |
9 | | - paths: |
10 | | - - .github/workflows/deploy.yml |
11 | | - schedule: |
12 | | - - cron: '23 * * * *' |
13 | | - workflow_dispatch: |
| 4 | + release: |
| 5 | + types: |
| 6 | + - published |
14 | 7 |
|
15 | 8 | concurrency: |
16 | | - group: ${{ github.workflow }}-${{ github.ref }} |
| 9 | + group: cd/vx/${{ github.event.release.tag_name }} |
17 | 10 | cancel-in-progress: true |
18 | 11 |
|
| 12 | +permissions: |
| 13 | + contents: write |
| 14 | + |
19 | 15 | jobs: |
20 | | - build: |
| 16 | + retag: |
21 | 17 | if: github.repository == 'pkgxdev/mash' |
22 | 18 | runs-on: ubuntu-latest |
23 | 19 | steps: |
24 | 20 | - uses: actions/checkout@v4 |
25 | | - - uses: pkgxdev/setup@v3 |
| 21 | + - uses: fischerscode/tagger@v0 |
| 22 | + with: |
| 23 | + prefix: v |
| 24 | + - run: | |
| 25 | + git tag -f latest |
| 26 | + git push origin latest --force |
26 | 27 |
|
27 | | - - name: trawl |
28 | | - run: .github/scripts/trawl.ts --out ./build |
29 | | - env: |
30 | | - GH_TOKEN: ${{ github.token }} |
| 28 | + attach: |
| 29 | + if: github.repository == 'pkgxdev/mash' |
| 30 | + runs-on: ubuntu-latest |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v4 |
31 | 33 |
|
32 | | - - name: index |
| 34 | + - name: version |
| 35 | + run: sed -i s/mash 0.0.0-dev/mash ${{ github.event.release.tag_name }}/g ./mash |
| 36 | + |
| 37 | + - name: prep |
33 | 38 | run: | |
34 | 39 | mkdir out |
35 | | - .github/scripts/index.ts --input ./build > ./out/index.json |
36 | | -
|
37 | | - - name: build |
38 | | - run: .github/scripts/build.ts --input ./build --output ./out --index-json ./out/index.json |
39 | | - |
40 | | - - uses: actions/configure-pages@v4 |
41 | | - - uses: actions/upload-pages-artifact@v3 |
42 | | - with: |
43 | | - path: out |
| 40 | + mv ./mash ./out/mash-${{ github.event.release.tag_name }}.sh |
44 | 41 |
|
45 | | - deploy: |
46 | | - needs: build |
47 | | - runs-on: ubuntu-latest |
48 | | - if: ${{ github.event_name != 'pull_request' }} |
49 | | - environment: |
50 | | - name: github-pages |
51 | | - url: ${{ steps.deployment.outputs.page_url }} |
52 | | - permissions: |
53 | | - pages: write # to deploy to Pages |
54 | | - id-token: write # to verify the deployment originates from an appropriate source |
55 | | - steps: |
56 | | - - uses: actions/deploy-pages@v4 |
57 | | - id: deployment |
| 42 | + - name: attach |
| 43 | + run: gh release upload ${{ github.event.release.tag_name }} ./out/mash-${{ github.event.release.tag_name }}.sh |
0 commit comments