File tree Expand file tree Collapse file tree 2 files changed +70
-0
lines changed
Expand file tree Collapse file tree 2 files changed +70
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish
2+ on :
3+ repository_dispatch :
4+ types : [ release-complete ]
5+
6+ jobs :
7+ publish :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - uses : actions/checkout@v2
11+ - name : Publish
12+ run : |
13+ echo "//registry.visualpinball.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
14+ npm publish
15+ env :
16+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
17+
18+ dispatch :
19+ runs-on : ubuntu-latest
20+ needs : [ publish ]
21+ steps :
22+ - uses : peter-evans/repository-dispatch@v1
23+ with :
24+ token : ${{ secrets.GH_PAT }}
25+ event-type : publish-complete
26+ client-payload : ' {"artifacts_run_id": "${{ github.run_id }}"}'
27+
Original file line number Diff line number Diff line change 1+ name : Release
2+ on : [push, pull_request]
3+
4+ jobs :
5+ release :
6+ runs-on : ubuntu-latest
7+ if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
8+ steps :
9+ - uses : actions/checkout@v2
10+ with :
11+ fetch-depth : 0
12+ lfs : true
13+ - name : Fetch next version
14+ id : nextVersion
15+ uses : VisualPinball/next-version-action@v0.1.7
16+ with :
17+ tagPrefix : ' v'
18+ - name : Bump
19+ if : ${{ steps.nextVersion.outputs.isBump == 'true' }}
20+ run : |
21+ npm version ${{ steps.nextVersion.outputs.nextVersion }} --no-git-tag-version
22+ - name : Commit
23+ id : commit
24+ if : ${{ steps.nextVersion.outputs.isBump == 'true' }}
25+ run : |
26+ git config user.name "github-actions"
27+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
28+ git add package.json
29+ git commit -m "release: ${{ steps.nextVersion.outputs.nextTag }}."
30+ git push
31+ commitish=$(git rev-parse HEAD)
32+ echo ::set-output name=commitish::${commitish}
33+ env :
34+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35+ - name : Create Release
36+ uses : actions/create-release@v1
37+ with :
38+ tag_name : ${{ steps.nextVersion.outputs.nextTag }}
39+ release_name : ${{ steps.nextVersion.outputs.nextTag }}
40+ prerelease : ${{ steps.nextVersion.outputs.isPrerelease }}
41+ commitish : ${{ steps.commit.outputs.commitish }}
42+ env :
43+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments