Visitar URL original
ci: publish v3 with npm trusted publishing (#2270) · svg/svgo@4c84fe7 · GitHub
Skip to content

Commit 4c84fe7

Browse files
authored
ci: publish v3 with npm trusted publishing (#2270)
## Summary - switch the v3 publish workflow from Yarn's publisher to npm 11.5.1 so npm trusted publishing can use GitHub OIDC - build the package with Yarn before invoking npm with lifecycle scripts disabled - always publish this release line under the `v3` dist-tag - use Node.js 24 for publishing This fixes the authentication failure observed while publishing v3.3.5 (`YN0033: No authentication configured for request`).
1 parent 994a9f0 commit 4c84fe7

1 file changed

Lines changed: 5 additions & 16 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,14 @@ permissions:
1010
jobs:
1111
publish-npm:
1212
runs-on: ubuntu-latest
13-
env:
14-
GH_TOKEN: ${{ github.token }}
1513
steps:
1614
- uses: actions/checkout@v6
1715
- uses: actions/setup-node@v6
1816
with:
19-
node-version: 20
17+
node-version: 24
2018
registry-url: https://registry.npmjs.org
19+
- run: corepack enable
20+
- run: npm install --global npm@11.5.1
2121
- run: yarn install
22-
- run: |
23-
VERSION=$(jq -r .version <package.json)
24-
if [[ "$VERSION" = *"-rc."* ]]; then
25-
yarn npm publish --access public --tag rc
26-
else
27-
LATEST_VERSION="$(gh release view --json tagName -q '.tagName' --repo ${{ github.repository }})"
28-
if [[ "${{ github.ref_name }}" = "$LATEST_VERSION" ]]; then
29-
yarn npm publish --access public
30-
else
31-
MAJOR="$(awk -F '.' '{ print $1 }' <<< "$VERSION")"
32-
yarn npm publish --access public --tag "v$MAJOR"
33-
fi
34-
fi
22+
- run: yarn prepublishOnly
23+
- run: npm publish --ignore-scripts --access public --tag v3

0 commit comments

Comments
 (0)