File tree 1 file changed +12
-10
lines changed
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change 1
1
name : Publish to Registry 📦
2
2
on :
3
- workflow_dispatch :
4
- inputs :
5
- version :
6
- description : ' The updated registry version number.'
7
- required : true
3
+ push :
4
+ tags :
5
+ - ' v*'
8
6
9
7
jobs :
10
8
build :
32
30
- run : yarn install --frozen-lockfile
33
31
- run : yarn build
34
32
- run : git stash
35
- - run : npm version ${{ github.event.inputs.version }} -m "Release ${{ github.event.inputs.version }} 📣"
33
+ - name : Set version to match the tag
34
+ run : |
35
+ VERSION=${GITHUB_REF#refs/tags/v}
36
+ npm version $VERSION -m "Release $VERSION 📣"
37
+ env :
38
+ GITHUB_REF : ${{ github.ref }}
36
39
- run : git push
37
40
38
41
# Publish to npm
@@ -48,11 +51,10 @@ jobs:
48
51
scope : ' @jamesives'
49
52
50
53
- name : Authenticate with the GitHub Package Registry
51
- run :
52
- echo "//npm.pkg.github.com:_authToken=${{ secrets.GITHUB_TOKEN }}" >
53
- ~/.npmrc
54
+ run : |
55
+ echo "//npm.pkg.github.com:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
54
56
55
57
# Publish to GitHub Packages
56
58
- run : npm publish
57
59
env :
58
- NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
60
+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments