forked from Consensys/starknet-snap
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (61 loc) · 1.87 KB
/
publish-release.yml
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
name: Publish Release
on:
workflow_call:
secrets:
NPM_TOKEN:
required: true
TAG:
required: true
jobs:
publish-npm-dry-run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.sha }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- uses: actions/cache@v3
id: restore-build
with:
# add /packages/snap/snap.manifest.json to include an updated shasum from build due to version update in auto PR
path: |
./packages/starknet-snap/dist/bundle.js
./packages/starknet-snap/snap.manifest.json
./node_modules/.yarn-state.yml
key: ${{ github.sha }}
- name: Dry Run Publish
run: |
ls -al ./packages/starknet-snap/dist
npm pack ./packages/starknet-snap --tag "$TAG" --access public
env:
TAG: ${{ secrets.TAG }}
publish-npm:
runs-on: ubuntu-latest
needs:
- publish-npm-dry-run
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.sha }}
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- uses: actions/cache@v3
id: restore-build
with:
# add /packages/snap/snap.manifest.json to include an updated shasum from build due to version update in auto PR
path: |
./packages/starknet-snap/dist/bundle.js
./packages/starknet-snap/snap.manifest.json
./node_modules/.yarn-state.yml
key: ${{ github.sha }}
- name: Run Publish
run: |
npm pack ./packages/starknet-snap --tag "$TAG" --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
TAG: ${{ secrets.TAG }}