Skip to content

Commit 04aefba

Browse files
authored
feat: switch to OIDC for NPM publishing
1 parent d8a479a commit 04aefba

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/publish_new_release.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
description: "The version number. default: the version number in package.json"
1010
required: false
1111

12+
permissions:
13+
id-token: write
14+
1215
concurrency:
1316
group: ${{ github.workflow }}-${{ github.ref }}
1417
cancel-in-progress: true
@@ -32,25 +35,23 @@ jobs:
3235
if [[ "$(npm show dl-librescore version)" != "$(node -p "require('./package.json').version")" ]]; then
3336
echo "updated=true" >> $GITHUB_ENV
3437
fi
35-
- uses: actions/setup-node@v2.4.1
38+
- uses: actions/setup-node@v6
3639
if: env.updated == 'true'
3740
with:
38-
node-version: 16
39-
registry-url: https://registry.npmjs.org/
41+
node-version: 24
42+
registry-url: https://registry.npmjs.org
4043
- name: Build userscript and command-line tool
4144
if: env.updated == 'true'
4245
run: |
4346
VER=$(node -p "require('./package.json').version")
4447
echo "VERSION=$VER" >> $GITHUB_ENV
45-
npm install
48+
npm ci
4649
npm version --allow-same-version --no-git-tag $VERSION
4750
npm run build
4851
npm run pack:ext
4952
- name: Publish command-line tool to NPM
5053
if: env.updated == 'true'
5154
run: npm publish --tag $NPM_TAG
52-
env:
53-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5455
- name: Publish GitHub Release
5556
if: env.updated == 'true'
5657
env:
@@ -70,3 +71,4 @@ jobs:
7071
if: env.updated == 'false'
7172
run: |
7273
curl -s -i -u ${{ secrets.LIBRESCORE_USERNAME }}:${{ secrets.LIBRESCORE_TOKEN }} -d '{"event_type":"delete_action","client_payload":{"run_id":"'"${{ github.run_id }}"'","repo":"LibreScore/dl-librescore"}}' -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/LibreScore/actions/dispatches
74+

0 commit comments

Comments
 (0)