-
-
Notifications
You must be signed in to change notification settings - Fork 9
76 lines (71 loc) · 2.19 KB
/
Copy pathpublish-release.yml
File metadata and controls
76 lines (71 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Publish Release
on:
workflow_call:
secrets:
NPM_TOKEN:
required: false
SLACK_WEBHOOK_URL:
required: true
permissions:
contents: read
jobs:
publish-npm-dry-run:
name: Publish to NPM (dry run)
runs-on: ubuntu-latest
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v3
with:
is-high-risk-environment: true
ref: ${{ github.sha }}
- name: Restore build artifacts
uses: actions/download-artifact@v8
with:
name: publish-release-artifacts-${{ github.sha }}
- name: Dry Run Publish
uses: MetaMask/action-npm-publish@v5
with:
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
subteam: S042S7RE4AE # @metamask-npm-publishers
publish-npm:
name: Publish to NPM
needs: publish-npm-dry-run
runs-on: ubuntu-latest
environment: npm-publish
permissions:
contents: read
id-token: write
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v3
with:
is-high-risk-environment: true
ref: ${{ github.sha }}
- name: Restore build artifacts
uses: actions/download-artifact@v8
with:
name: publish-release-artifacts-${{ github.sha }}
- name: Publish
uses: MetaMask/action-npm-publish@v6
with:
# This `NPM_TOKEN` needs to be manually set to publish a package for
# the first time only.
# Look in the repository settings under "Environments", and set this
# token in the `npm-publish` environment, and delete it after the
# initial publish.
npm-token: ${{ secrets.NPM_TOKEN }}
publish-release:
name: Publish to GitHub
needs: publish-npm
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v3
with:
is-high-risk-environment: true
ref: ${{ github.sha }}
- uses: MetaMask/action-publish-release@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}