fix(release): use npm trusted publishing

This commit is contained in:
Andrey Avtomonov 2026-05-17 01:03:39 +02:00
parent 45374fa3ab
commit ceb578e0f6
2 changed files with 3 additions and 2 deletions

View file

@ -24,6 +24,7 @@ on:
permissions: permissions:
contents: write contents: write
id-token: write
concurrency: concurrency:
group: ktx-release-${{ github.ref }} group: ktx-release-${{ github.ref }}
@ -124,4 +125,3 @@ jobs:
KTX_RELEASE_KIND: ${{ inputs.release_kind }} KTX_RELEASE_KIND: ${{ inputs.release_kind }}
KTX_PRERELEASE_BRANCH: next KTX_PRERELEASE_BRANCH: next
FORCE_RELEASE: ${{ inputs.force_release }} FORCE_RELEASE: ${{ inputs.force_release }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

View file

@ -14,6 +14,7 @@ describe('release workflow', () => {
assert.match(workflow, /publish_live:/); assert.match(workflow, /publish_live:/);
assert.match(workflow, /default: false/); assert.match(workflow, /default: false/);
assert.match(workflow, /^ contents: write$/m); assert.match(workflow, /^ contents: write$/m);
assert.match(workflow, /^ id-token: write$/m);
assert.match(workflow, /fetch-depth: 0/); assert.match(workflow, /fetch-depth: 0/);
assert.match(workflow, /registry-url: "https:\/\/registry\.npmjs\.org"/); assert.match(workflow, /registry-url: "https:\/\/registry\.npmjs\.org"/);
assert.match(workflow, /Prepare next prerelease branch/); assert.match(workflow, /Prepare next prerelease branch/);
@ -24,7 +25,7 @@ describe('release workflow', () => {
assert.match(workflow, /KTX_RELEASE_KIND: \$\{\{ inputs.release_kind \}\}/); assert.match(workflow, /KTX_RELEASE_KIND: \$\{\{ inputs.release_kind \}\}/);
assert.match(workflow, /KTX_PRERELEASE_BRANCH: next/); assert.match(workflow, /KTX_PRERELEASE_BRANCH: next/);
assert.match(workflow, /FORCE_RELEASE: \$\{\{ inputs.force_release \}\}/); assert.match(workflow, /FORCE_RELEASE: \$\{\{ inputs.force_release \}\}/);
assert.match(workflow, /NODE_AUTH_TOKEN: \$\{\{ secrets.NPM_TOKEN \}\}/); assert.doesNotMatch(workflow, /NODE_AUTH_TOKEN/);
assert.doesNotMatch(workflow, /^ push:/m); assert.doesNotMatch(workflow, /^ push:/m);
assert.doesNotMatch(workflow, /^ pull_request:/m); assert.doesNotMatch(workflow, /^ pull_request:/m);
}); });