40
40
- all
41
41
- npm
42
42
- extension
43
-
43
+ permissions :
44
+ # Provenance generation in GitHub Actions requires "write" access to the "id-token"
45
+ id-token : write
46
+ contents : read
44
47
env :
45
48
GO_VERSION : ' 1.24.1'
46
49
@@ -49,11 +52,12 @@ jobs:
49
52
if : ${{ inputs.to_release == 'all' || inputs.to_release == 'npm' }}
50
53
name : ${{ inputs.dry_run == true && 'Dry Run - NPM Packages' || 'Publish NPM Packages' }}
51
54
needs : [build]
52
- runs-on : rspack-ubuntu-22.04-large
55
+ runs-on : ubuntu-22.04
56
+ environment : npm
53
57
steps :
54
58
- name : Show dry-run status
55
59
run : |
56
- if [ "${{ github.event. inputs.dry_run }}" = "true" ]; then
60
+ if [ "${{ inputs.dry_run }}" = "true" ]; then
57
61
echo "🏃♂️ RUNNING IN DRY-RUN MODE - No packages will be published to npm registry"
58
62
echo "=================================================="
59
63
else
72
76
uses : actions/setup-node@v4
73
77
with :
74
78
node-version : ' 24'
79
+ # Update npm to the latest version to enable OIDC
80
+ - name : Update npm
81
+ run : |
82
+ npm install -g npm@latest
83
+ npm --version
75
84
76
85
- name : Install pnpm
77
86
run : corepack enable
@@ -88,11 +97,10 @@ jobs:
88
97
uses : ./.github/actions/move-artifacts
89
98
90
99
- name : Publish npm packages
91
- if : ${{ github.event. inputs.dry_run == false }}
100
+ if : ${{ inputs.dry_run == false }}
92
101
env :
93
102
NPM_TOKEN : ${{ secrets.RSLINT_NPM_TOKEN }}
94
103
run : |
95
- npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}"
96
104
pnpm -r publish --no-git-checks --tag ${{ github.event.inputs.npm_tag }} --publish-branch ${{ github.event.inputs.branch }}
97
105
98
106
publish-extesion :
@@ -128,15 +136,15 @@ jobs:
128
136
env :
129
137
VSCE_PAT : ${{ secrets.RSLINT_VSCE_PAT }}
130
138
run : |
131
- if [ "${{ github.event. inputs.dry_run }}" = "true" ]; then
139
+ if [ "${{ inputs.dry_run }}" = "true" ]; then
132
140
echo "🚀 DRY RUN: Building and packaging VS Code extension without publishing..."
133
- if [ "${{ github.event. inputs.extension_type }}" = "pre-release" ]; then
141
+ if [ "${{ inputs.extension_type }}" = "pre-release" ]; then
134
142
pnpm publish:vsce --prerelease --dry-run
135
143
else
136
144
pnpm publish:vsce --dry-run
137
145
fi
138
146
else
139
- if [ "${{ github.event. inputs.extension_type }}" = "pre-release" ]; then
147
+ if [ "${{ inputs.extension_type }}" = "pre-release" ]; then
140
148
pnpm publish:vsce --prerelease
141
149
else
142
150
pnpm publish:vsce
@@ -152,15 +160,15 @@ jobs:
152
160
env :
153
161
OVSX_PAT : ${{ secrets.RSLINT_OVSX_PAT }}
154
162
run : |
155
- if [ "${{ github.event. inputs.dry_run }}" = "true" ]; then
163
+ if [ "${{ inputs.dry_run }}" = "true" ]; then
156
164
echo "🚀 DRY RUN: Building and packaging for Open VSX Registry without publishing..."
157
- if [ "${{ github.event. inputs.extension_type }}" = "pre-release" ]; then
165
+ if [ "${{ inputs.extension_type }}" = "pre-release" ]; then
158
166
pnpm publish:ovsx --prerelease --dry-run
159
167
else
160
168
pnpm publish:ovsx --dry-run
161
169
fi
162
170
else
163
- if [ "${{ github.event. inputs.extension_type }}" = "pre-release" ]; then
171
+ if [ "${{ inputs.extension_type }}" = "pre-release" ]; then
164
172
pnpm publish:ovsx --prerelease
165
173
else
166
174
pnpm publish:ovsx
@@ -169,7 +177,7 @@ jobs:
169
177
170
178
check :
171
179
name : Test
172
- if : ${{ github.event. inputs.dry_run == false }}
180
+ if : ${{ inputs.dry_run == false }}
173
181
needs : build
174
182
strategy :
175
183
fail-fast : true
0 commit comments