Skip to content

Commit cd654da

Browse files
committed
build: Add publish workflow.
1 parent 0b2f8a2 commit cd654da

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
on: [push, pull_request]
2+
jobs:
3+
release:
4+
runs-on: ubuntu-latest
5+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
6+
steps:
7+
- uses: actions/checkout@v2
8+
with:
9+
fetch-depth: 0
10+
- name: Fetch next version
11+
id: nextVersion
12+
uses: freezy/VisualPinball.NextVersionAction@v0.1.4
13+
with:
14+
tagPrefix: 'v'
15+
- name: Publish
16+
run: |
17+
echo "//registry.visualpinball.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
18+
npm version ${{ steps.nextVersion.outputs.nextVersion }} --no-git-tag-version --allow-same-version
19+
npm publish
20+
env:
21+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
22+
- name: Create Release
23+
uses: actions/create-release@v1
24+
with:
25+
tag_name: ${{ steps.nextVersion.outputs.nextTag }}
26+
release_name: ${{ steps.nextVersion.outputs.nextTag }}
27+
prerelease: ${{ steps.nextVersion.outputs.isPrerelease }}
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+

0 commit comments

Comments
 (0)