Skip to content

Commit 41fb13e

Browse files
ci: Enable Trusted Publishing
1 parent 3776a16 commit 41fb13e

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

.github/workflows/release-dev.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
- 'main'
88
workflow_dispatch:
99

10+
permissions:
11+
id-token: write # Required for OIDC for trusted publishing
12+
contents: read
13+
1014
jobs:
1115
setup:
1216
uses: ./.github/workflows/reusable_setup.yml
@@ -32,5 +36,4 @@ jobs:
3236
create-dev-release: true
3337
create-rc-release: false
3438
secrets:
35-
CAP_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
36-
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
39+
CAP_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}

.github/workflows/release-rc.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: "Release RC"
22

33
on: workflow_dispatch
44

5+
permissions:
6+
id-token: write # Required for OIDC for trusted publishing
7+
contents: read
8+
59
jobs:
610
setup:
711
uses: ./.github/workflows/reusable_setup.yml
@@ -27,5 +31,4 @@ jobs:
2731
create-dev-release: false
2832
create-rc-release: true
2933
secrets:
30-
CAP_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
31-
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
34+
CAP_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: "Release"
22

33
on: workflow_dispatch
44

5+
permissions:
6+
id-token: write # Required for OIDC for trusted publishing
7+
contents: read
8+
59
jobs:
610
setup:
711
uses: ./.github/workflows/reusable_setup.yml
@@ -27,5 +31,4 @@ jobs:
2731
create-dev-release: false
2832
create-rc-release: false
2933
secrets:
30-
CAP_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
31-
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
34+
CAP_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}

.github/workflows/reusable_release-npm.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ on:
1414
secrets:
1515
CAP_GH_RELEASE_TOKEN:
1616
required: true
17-
NPM_TOKEN:
18-
required: true
1917

2018
jobs:
2119
build:
@@ -35,11 +33,6 @@ jobs:
3533
run: |
3634
RELEASE_TYPE="$([[ "$(git describe --abbrev=0 --tags)" =~ ^v[0-9]{1,}[\.][0-9]{1,}[\.][0-9]{1,}[-]((beta)|(rc)|(alpha))[\.][0-9]{1,}$ ]] && echo "prerelease" || echo "release")"
3735
echo "releasetype=$RELEASE_TYPE" >> $GITHUB_ENV
38-
39-
- name: "NPM Identity"
40-
run: |
41-
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
42-
npm whoami
4336
4437
- name: "Git Config"
4538
run: |
@@ -50,7 +43,6 @@ jobs:
5043
if: inputs.create-dev-release
5144
shell: bash
5245
env:
53-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5446
GH_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
5547
run: |
5648
pnpm run publish:dev
@@ -59,7 +51,6 @@ jobs:
5951
if: "!inputs.create-dev-release && inputs.create-rc-release"
6052
shell: bash
6153
env:
62-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6354
GH_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
6455
run: |
6556
pnpm run publish:rc
@@ -68,7 +59,6 @@ jobs:
6859
if: ${{ !inputs.create-dev-release && !inputs.create-rc-release && env.releasetype == 'prerelease' }}
6960
shell: bash
7061
env:
71-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7262
GH_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
7363
run: |
7464
pnpm run publish:release-from-prerelease
@@ -77,7 +67,6 @@ jobs:
7767
if: ${{ !inputs.create-dev-release && !inputs.create-rc-release && env.releasetype == 'release' }}
7868
shell: bash
7969
env:
80-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
8170
GH_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
8271
run: |
8372
pnpm run publish:latest

0 commit comments

Comments
 (0)