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 7
7
permissions :
8
8
contents : write
9
9
jobs :
10
- publish :
10
+ check :
11
11
runs-on : ubuntu-latest
12
12
environment : Production
13
+ outputs :
14
+ VERSION_EXISTS : ${{ steps.check-version.outputs.VERSION_EXISTS }}
15
+ VERSION : ${{ steps.get-version.outputs.VERSION }}
13
16
steps :
14
17
- uses : GitHubSecurityLab/actions-permissions/monitor@v1
15
18
- uses : actions/checkout@v4
@@ -40,26 +43,28 @@ jobs:
40
43
else
41
44
echo "VERSION_EXISTS=false" >> "$GITHUB_OUTPUT"
42
45
fi
46
+ publish :
47
+ runs-on : ubuntu-latest
48
+ environment : Production
49
+ needs : check
50
+ if : needs.check.outputs.VERSION_EXISTS == 'false'
51
+ steps :
43
52
- name : Build package
44
- if : steps.check-version.outputs.VERSION_EXISTS == 'false'
45
53
run : |
46
54
npm ci
47
55
npm run build
48
56
- name : Publish to NPM
49
- if : steps.check-version.outputs.VERSION_EXISTS == 'false'
50
57
run : npm publish
51
58
env :
52
59
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
53
60
- name : Publish git tag
54
- if : steps.check-version.outputs.VERSION_EXISTS == 'false'
55
61
run : |
56
62
git config --global user.name 'github-actions[bot]'
57
63
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 }}
59
65
git push origin --tags
60
66
- name : Publish git release
61
- if : steps.check-version.outputs.VERSION_EXISTS == 'false'
62
67
env :
63
68
GH_TOKEN : ${{ github.token }}
64
69
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