|
1 |
| -on: [push, pull_request] |
| 1 | +on: |
| 2 | + repository_dispatch: |
| 3 | + types: [ release-complete ] |
2 | 4 |
|
3 | 5 | jobs:
|
4 | 6 | publish:
|
5 | 7 | runs-on: ubuntu-latest
|
6 | 8 | if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
7 | 9 | steps:
|
8 | 10 | - uses: actions/checkout@v4
|
9 |
| - with: |
10 |
| - fetch-depth: 0 |
11 |
| - lfs: true |
12 |
| - - name: Fetch next version |
13 |
| - id: nextVersion |
14 |
| - uses: VisualPinball/next-version-action@v0 |
15 |
| - with: |
16 |
| - tagPrefix: 'v' |
17 |
| - - name: Bump |
18 |
| - if: ${{ steps.nextVersion.outputs.isBump == 'true' }} |
19 |
| - run: | |
20 |
| - npm version ${{ steps.nextVersion.outputs.nextVersion }} --no-git-tag-version |
21 | 11 | - name: Publish
|
22 | 12 | run: |
|
23 | 13 | echo "//registry.visualpinball.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
24 | 14 | npm publish
|
25 | 15 | env:
|
26 | 16 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
27 |
| - - name: Commit |
28 |
| - id: commit |
29 |
| - if: ${{ steps.nextVersion.outputs.isBump == 'true' }} |
30 |
| - run: | |
31 |
| - git config user.name "github-actions" |
32 |
| - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
33 |
| - git add package.json |
34 |
| - git commit -m "release: ${{ steps.nextVersion.outputs.nextTag }}." |
35 |
| - git push |
36 |
| - commitish=$(git rev-parse HEAD) |
37 |
| - echo "commitish=${commitish}" >> $GITHUB_OUTPUT |
38 |
| - env: |
39 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
40 |
| - - name: Create Release |
41 |
| - uses: softprops/action-gh-release@v2 |
42 |
| - with: |
43 |
| - tag_name: ${{ steps.nextVersion.outputs.nextTag }} |
44 |
| - name: ${{ steps.nextVersion.outputs.nextTag }} |
45 |
| - prerelease: ${{ steps.nextVersion.outputs.isPrerelease }} |
46 |
| - target_commitish: ${{ steps.commit.outputs.commitish }} |
47 |
| - token: ${{ secrets.GITHUB_TOKEN }} |
48 | 17 |
|
| 18 | + dispatch: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + needs: [ publish ] |
| 21 | + steps: |
| 22 | + - name: Repository Dispatch |
| 23 | + uses: peter-evans/repository-dispatch@v3 |
| 24 | + with: |
| 25 | + event-type: publish-complete |
0 commit comments