Skip to content

Commit 0b1c95d

Browse files
committed
ci: use new token-exchange-service for releases
1 parent 47d8192 commit 0b1c95d

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ jobs:
8686
name: Publish release
8787
permissions:
8888
contents: write
89+
id-token: write
8990
uses: ./.github/workflows/publish-release.yml
9091
secrets:
9192
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/publish-release.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,23 @@ on:
44
workflow_call:
55
secrets:
66
NPM_TOKEN:
7-
required: true
7+
required: false
88
SLACK_WEBHOOK_URL:
99
required: true
1010
PUBLISH_DOCS_TOKEN:
1111
required: true
12+
13+
permissions:
14+
contents: read
15+
1216
jobs:
1317
publish-release:
1418
permissions:
1519
contents: write
1620
runs-on: ubuntu-latest
1721
steps:
1822
- name: Checkout and setup environment
19-
uses: MetaMask/action-checkout-and-setup@v1
23+
uses: MetaMask/action-checkout-and-setup@v3
2024
with:
2125
is-high-risk-environment: true
2226
ref: ${{ github.sha }}
@@ -25,7 +29,7 @@ jobs:
2529
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2630
- run: yarn build
2731
- name: Upload build artifacts
28-
uses: actions/upload-artifact@v4
32+
uses: actions/upload-artifact@v7
2933
with:
3034
name: publish-release-artifacts-${{ github.sha }}
3135
retention-days: 4
@@ -39,17 +43,17 @@ jobs:
3943
runs-on: ubuntu-latest
4044
steps:
4145
- name: Checkout and setup environment
42-
uses: MetaMask/action-checkout-and-setup@v1
46+
uses: MetaMask/action-checkout-and-setup@v3
4347
with:
4448
is-high-risk-environment: true
4549
ref: ${{ github.sha }}
4650
- name: Restore build artifacts
47-
uses: actions/download-artifact@v4
51+
uses: actions/download-artifact@v8
4852
with:
4953
name: publish-release-artifacts-${{ github.sha }}
5054
- name: Dry Run Publish
5155
# omit npm-token token to perform dry run publish
52-
uses: MetaMask/action-npm-publish@v5
56+
uses: MetaMask/action-npm-publish@v6
5357
with:
5458
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
5559
subteam: S042S7RE4AE # @metamask-npm-publishers
@@ -60,18 +64,21 @@ jobs:
6064
needs: publish-npm-dry-run
6165
runs-on: ubuntu-latest
6266
environment: npm-publish
67+
permissions:
68+
contents: read
69+
id-token: write
6370
steps:
6471
- name: Checkout and setup environment
65-
uses: MetaMask/action-checkout-and-setup@v1
72+
uses: MetaMask/action-checkout-and-setup@v3
6673
with:
6774
is-high-risk-environment: true
6875
ref: ${{ github.sha }}
6976
- name: Restore build artifacts
70-
uses: actions/download-artifact@v4
77+
uses: actions/download-artifact@v8
7178
with:
7279
name: publish-release-artifacts-${{ github.sha }}
7380
- name: Publish
74-
uses: MetaMask/action-npm-publish@v5
81+
uses: MetaMask/action-npm-publish@v6
7582
with:
7683
# This `NPM_TOKEN` needs to be manually set per-repository.
7784
# Look in the repository settings under "Environments", and set this token in the `npm-publish` environment.

0 commit comments

Comments
 (0)