12
12
outputs :
13
13
VERSION_EXISTS : ${{ steps.check-version.outputs.VERSION_EXISTS }}
14
14
VERSION : ${{ steps.get-version.outputs.VERSION }}
15
+ RELEASE_CHANNEL : ${{ steps.npm-tag.outputs.RELEASE_CHANNEL }}
15
16
steps :
16
17
- uses : GitHubSecurityLab/actions-permissions/monitor@v1
17
18
- uses : actions/checkout@v5
42
43
else
43
44
echo "VERSION_EXISTS=false" >> "$GITHUB_OUTPUT"
44
45
fi
46
+ - name : Get npm tag
47
+ id : npm-tag
48
+ run : |
49
+ $regex = "^v?(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:[^.]*)))?"
50
+ $version = "${{ steps.get-version.outputs.VERSION }}"
51
+ $releaseChannel = $groups["prerelease"][0].value
52
+
53
+ if ([string]::IsNullOrEmpty($releaseChannel)) {
54
+ $releaseChannel = "latest"
55
+ }
56
+ Write-Output "RELEASE_CHANNEL=$releaseChannel" >> $Env:GITHUB_OUTPUT
57
+ - name : Output deployment info
58
+ run : echo "::notice title=Deployment Info::Deploying version ${{ steps.get-version.outputs.VERSION }} to channel ${{ steps.npm-tag.outputs.RELEASE_CHANNEL }}"
59
+
45
60
publish :
46
61
runs-on : ubuntu-latest
47
62
environment : Production
@@ -58,24 +73,13 @@ jobs:
58
73
node-version-file : package.json
59
74
registry-url : " https://registry.npmjs.org"
60
75
cache : " npm"
61
- - name : Get npm tag
62
- id : npm-tag
63
- run : |
64
- $regex = "^v?(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:[^.]*)))?"
65
- $version = "${{ needs.check.outputs.VERSION }}"
66
- $releaseChannel = $groups["prerelease"][0].value
67
-
68
- if ([string]::IsNullOrEmpty($releaseChannel)) {
69
- $releaseChannel = "latest"
70
- }
71
- Write-Output "RELEASE_CHANNEL=$releaseChannel" >> $Env:GITHUB_OUTPUT
72
76
73
77
- name : Build package
74
78
run : |
75
79
npm ci
76
80
npm run build
77
81
- name : Publish to NPM
78
- run : npm publish --tag ${{ steps.npm-tag .outputs.RELEASE_CHANNEL }}
82
+ run : npm publish --tag ${{ needs.check .outputs.RELEASE_CHANNEL }}
79
83
env :
80
84
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
81
85
- name : Publish git release
0 commit comments