File tree Expand file tree Collapse file tree 2 files changed +12
-44
lines changed
Expand file tree Collapse file tree 2 files changed +12
-44
lines changed Original file line number Diff line number Diff line change 77permissions :
88 contents : write
99jobs :
10- publish :
10+ check :
1111 runs-on : ubuntu-latest
1212 environment : Production
13+ outputs :
14+ VERSION_EXISTS : ${{ steps.check-version.outputs.VERSION_EXISTS }}
15+ VERSION : ${{ steps.get-version.outputs.VERSION }}
1316 steps :
1417 - uses : GitHubSecurityLab/actions-permissions/monitor@v1
1518 - uses : actions/checkout@v4
@@ -40,26 +43,28 @@ jobs:
4043 else
4144 echo "VERSION_EXISTS=false" >> "$GITHUB_OUTPUT"
4245 fi
46+ publish :
47+ runs-on : ubuntu-latest
48+ environment : Production
49+ needs : check
50+ if : needs.check.outputs.VERSION_EXISTS == 'false'
51+ steps :
4352 - name : Build package
44- if : steps.check-version.outputs.VERSION_EXISTS == 'false'
4553 run : |
4654 npm ci
4755 npm run build
4856 - name : Publish to NPM
49- if : steps.check-version.outputs.VERSION_EXISTS == 'false'
5057 run : npm publish
5158 env :
5259 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
5360 - name : Publish git tag
54- if : steps.check-version.outputs.VERSION_EXISTS == 'false'
5561 run : |
5662 git config --global user.name 'github-actions[bot]'
5763 git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
58- git tag ${{ steps.get-version .outputs.VERSION }}
64+ git tag ${{ needs.check .outputs.VERSION }}
5965 git push origin --tags
6066 - name : Publish git release
61- if : steps.check-version.outputs.VERSION_EXISTS == 'false'
6267 env :
6368 GH_TOKEN : ${{ github.token }}
6469 run : |
65- gh release create ${{ github.env. VERSION }} --title "${{ github.env .VERSION }}" --generate-notes
70+ gh release create ${{ needs.check.outputs. VERSION }} --title "${{ needs.check.outputs .VERSION }}" --generate-notes
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments