Skip to content

Commit 92149df

Browse files
committed
ci: update next-version-action. commit package.json updates.
1 parent 66c91c5 commit 92149df

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed
Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,49 @@
11
on: [push, pull_request]
2+
23
jobs:
3-
release:
4+
publish:
45
runs-on: ubuntu-latest
56
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
67
steps:
78
- uses: actions/checkout@v2
89
with:
910
fetch-depth: 0
10-
lfs: true
11+
lfs: true
1112
- name: Fetch next version
1213
id: nextVersion
13-
uses: freezy/VisualPinball.NextVersionAction@v0.1.4
14+
uses: VisualPinball/next-version-action@v0.1.6
1415
with:
1516
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
1621
- name: Publish
1722
run: |
1823
echo "//registry.visualpinball.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
19-
npm version ${{ steps.nextVersion.outputs.nextVersion }} --no-git-tag-version --allow-same-version
2024
npm publish
2125
env:
2226
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 "chore(deps): Update to ${{ steps.nextVersion.outputs.nextTag }}."
35+
git push
36+
commitish=$(git rev-parse HEAD)
37+
echo ::set-output name=commitish::${commitish}
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2340
- name: Create Release
2441
uses: actions/create-release@v1
2542
with:
2643
tag_name: ${{ steps.nextVersion.outputs.nextTag }}
2744
release_name: ${{ steps.nextVersion.outputs.nextTag }}
2845
prerelease: ${{ steps.nextVersion.outputs.isPrerelease }}
46+
commitish: ${{ steps.commit.outputs.commitish }}
2947
env:
3048
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3149

0 commit comments

Comments
 (0)