ci: Switch to OIDC trusted publishing for npm (no token needed)
This commit is contained in:
@@ -4,14 +4,17 @@ stages:
|
|||||||
semantic-release:
|
semantic-release:
|
||||||
stage: release
|
stage: release
|
||||||
image: node:lts-alpine
|
image: node:lts-alpine
|
||||||
|
id_tokens:
|
||||||
|
NPM_ID_TOKEN:
|
||||||
|
aud: "npm:registry.npmjs.org"
|
||||||
|
SIGSTORE_ID_TOKEN:
|
||||||
|
aud: sigstore
|
||||||
before_script:
|
before_script:
|
||||||
- apk add git openssh
|
- apk add git openssh
|
||||||
- mkdir -p ~/.ssh
|
- mkdir -p ~/.ssh
|
||||||
- echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
- echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
||||||
- ssh-keyscan -H gitlab.com >> ~/.ssh/known_hosts
|
- ssh-keyscan -H gitlab.com >> ~/.ssh/known_hosts
|
||||||
- chmod 600 ~/.ssh/id_ed25519
|
- chmod 600 ~/.ssh/id_ed25519
|
||||||
- export NPM_TOKEN="${NODE_AUTH_TOKEN}"
|
|
||||||
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
|
|
||||||
- npm install
|
- npm install
|
||||||
- npm run build
|
- npm run build
|
||||||
script:
|
script:
|
||||||
|
|||||||
Reference in New Issue
Block a user