File tree 1 file changed +17
-5
lines changed
1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change 1
1
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
2
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
3
4
- name : Publish to NPM (using yarn)
4
+ name : Publish to NPM
5
5
6
6
on :
7
7
release :
@@ -23,13 +23,25 @@ jobs:
23
23
needs : build
24
24
runs-on : ubuntu-latest
25
25
steps :
26
- - uses : actions/checkout@v3
27
- - uses : actions/setup-node@v3
26
+ - name : ' Checkout tagged commit'
27
+ uses : actions/checkout@v3
28
+ with :
29
+ ref : ${{ github.event.release.target_commitish }}
30
+ - name : ' Setup Node.js'
31
+ uses : actions/setup-node@v3
28
32
with :
29
33
node-version : 18.x
30
34
registry-url : https://registry.npmjs.org/
31
35
cache : yarn
32
- - run : yarn --frozen-lockfile
33
- - run : yarn publish
36
+ - name : ' Install dependencies'
37
+ run : yarn --frozen-lockfile
38
+ - name : ' Publish dotenv-flow@next'
39
+ if : steps.release.outputs.tag != ''
40
+ run : yarn publish --tag=next
41
+ env :
42
+ NODE_AUTH_TOKEN : ${{ secrets.YARN_NPM_AUTH_TOKEN }}
43
+ - name : ' Publish dotenv-flow@latest'
44
+ if : steps.release.outputs.tag == ''
45
+ run : yarn publish
34
46
env :
35
47
NODE_AUTH_TOKEN : ${{ secrets.YARN_NPM_AUTH_TOKEN }}
You can’t perform that action at this time.
0 commit comments