Skip to content

Commit c12d451

Browse files
authored
Merge pull request #2365 from thirdweb-dev/jl/github-ci
Setting up GitHub CI for packages
2 parents 8712513 + d9a37ee commit c12d451

File tree

2 files changed

+350
-0
lines changed

2 files changed

+350
-0
lines changed

.github/workflows/node-production.yml

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
name: Node Packages – Production Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
id-token: write # for provenance / npm‑pkg OIDC
10+
packages: write
11+
12+
env:
13+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
14+
15+
jobs:
16+
build-and-publish:
17+
name: Build & publish ${{ matrix.package }}
18+
runs-on: ubuntu-latest
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
include:
24+
- package: core # 1
25+
node: 16.15.1
26+
- package: common # 2
27+
node: 16.13.1
28+
- package: fortmatic # 3
29+
node: 16.13.1
30+
- package: gnosis # 4
31+
node: 16.13.1
32+
- package: injected # 5
33+
node: 16.13.1
34+
- package: frame # 6
35+
node: 16.13.1
36+
- package: keepkey # 7
37+
node: 16.20.2
38+
- package: keystone # 8
39+
node: 18.0.0
40+
- package: ledger # 9
41+
node: 18.0.0
42+
- package: mew # 10
43+
node: 16.13.1
44+
- package: mew-wallet # 11
45+
node: 16.13.1
46+
- package: portis # 12
47+
node: 16.13.1
48+
- package: torus # 13
49+
node: 16.18.1
50+
- package: trezor # 14
51+
node: 20.18.0
52+
- package: trust # 15
53+
node: 16.13.1
54+
- package: okx # 16
55+
node: 16.13.1
56+
- package: frontier # 17
57+
node: 16.13.1
58+
- package: walletconnect # 18
59+
node: 18.0.0
60+
- package: walletlink # 19
61+
node: 16.13.1
62+
- package: react # 20
63+
node: 16.15.1
64+
- package: magic # 21
65+
node: 16.13.1
66+
- package: coinbase # 22
67+
node: 16.13.1
68+
- package: web3auth # 23
69+
node: 18.0.0
70+
- package: dcent # 24
71+
node: 16.13.1
72+
- package: vue # 25
73+
node: 16.15.1
74+
- package: gas # 26
75+
node: 16.13.1
76+
- package: hw-common # 27
77+
node: 16.13.1
78+
- package: sequence # 28
79+
node: 16.13.1
80+
- package: tallyho # 29
81+
node: 16.13.1
82+
- package: enkrypt # 30
83+
node: 16.13.1
84+
- package: uauth # 31
85+
node: 18.0.0
86+
- package: transaction-preview # 32
87+
node: 16.13.1
88+
- package: zeal # 33
89+
node: 16.13.1
90+
- package: phantom # 34
91+
node: 16.13.1
92+
- package: xdefi # 35
93+
node: 16.13.1
94+
- package: infinity-wallet # 36
95+
node: 16.13.1
96+
- package: taho # 37
97+
node: 16.13.1
98+
- package: unstoppable-resolution # 38
99+
node: 16.13.1
100+
- package: cede-store # 39
101+
node: 16.13.1
102+
- package: arcana-auth # 40
103+
node: 18.0.0
104+
- package: blocto # 41
105+
node: 16.13.1
106+
- package: venly # 42
107+
node: 18.18.2
108+
- package: bitget # 43
109+
node: 16.13.1
110+
- package: bitkeep # 44
111+
node: 16.13.1
112+
- package: metamask # 45
113+
node: 18.18.2
114+
- package: solid # 46
115+
node: 16.15.1
116+
- package: para # 47
117+
node: 18.18.2
118+
- package: particle-network # 48
119+
node: 18.0.0
120+
- package: finoaconnect # 49
121+
node: 18.0.0
122+
- package: wagmi # 50
123+
node: 18.0.0
124+
- package: passport # 51
125+
node: 18.0.0
126+
- package: bloom # 52
127+
node: 18.0.0
128+
- package: keplr # 53
129+
node: 18.0.0
130+
131+
defaults:
132+
run:
133+
shell: bash
134+
working-directory: packages/${{ matrix.package }}
135+
136+
steps:
137+
- uses: actions/checkout@v4
138+
139+
- name: Use Node ${{ matrix.node }}
140+
uses: actions/setup-node@v4
141+
with:
142+
node-version: ${{ matrix.node }}
143+
registry-url: https://registry.npmjs.org/
144+
145+
# ────── skip alpha versions ──────
146+
- id: version
147+
run: echo "v=$(node -p 'require(\"./package.json\").version')" >> "$GITHUB_OUTPUT"
148+
149+
- name: Skip alpha builds on main
150+
if: contains(steps.version.outputs.v, '-alpha')
151+
run: echo "Alpha version detected – skipping publish."
152+
# ─────────────────────────────────
153+
154+
- name: Cache Yarn
155+
uses: actions/cache@v3
156+
with:
157+
path: |
158+
~/.cache/yarn
159+
node_modules
160+
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
161+
162+
- name: Generate workspace lock‑file
163+
run: yarn generate-lock-entry >> yarn.lock
164+
165+
- name: Install dependencies
166+
run: yarn --immutable
167+
168+
- name: Type‑check & build
169+
run: |
170+
yarn type-check
171+
yarn build
172+
173+
- name: Publish to npm (latest)
174+
if: ${{ !contains(steps.version.outputs.v, '-alpha') }}
175+
run: npm publish --access public

.github/workflows/node-staging.yml

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
name: Node Packages – Staging (Alpha ➜ next)
2+
3+
on:
4+
push:
5+
branches: [develop]
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
packages: write
11+
12+
env:
13+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
14+
15+
jobs:
16+
build-and-publish:
17+
name: Build & publish alpha ${{ matrix.package }}
18+
runs-on: ubuntu-latest
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
include:
24+
- package: core
25+
node: 16.15.1
26+
- package: common
27+
node: 16.13.1
28+
- package: fortmatic
29+
node: 16.13.1
30+
- package: gnosis
31+
node: 16.13.1
32+
- package: injected
33+
node: 16.13.1
34+
- package: frame
35+
node: 16.13.1
36+
- package: keepkey
37+
node: 16.20.2
38+
- package: keystone
39+
node: 18.0.0
40+
- package: ledger
41+
node: 18.0.0
42+
- package: mew
43+
node: 16.13.1
44+
- package: mew-wallet
45+
node: 16.13.1
46+
- package: portis
47+
node: 16.13.1
48+
- package: torus
49+
node: 16.18.1
50+
- package: trezor
51+
node: 20.18.0
52+
- package: trust
53+
node: 16.13.1
54+
- package: okx
55+
node: 16.13.1
56+
- package: frontier
57+
node: 16.13.1
58+
- package: walletconnect
59+
node: 18.0.0
60+
- package: walletlink
61+
node: 16.13.1
62+
- package: react
63+
node: 16.15.1
64+
- package: magic
65+
node: 16.13.1
66+
- package: coinbase
67+
node: 16.13.1
68+
- package: web3auth
69+
node: 18.0.0
70+
- package: dcent
71+
node: 16.13.1
72+
- package: vue
73+
node: 16.15.1
74+
- package: gas
75+
node: 16.13.1
76+
- package: hw-common
77+
node: 16.13.1
78+
- package: sequence
79+
node: 16.13.1
80+
- package: tallyho
81+
node: 16.13.1
82+
- package: enkrypt
83+
node: 16.13.1
84+
- package: uauth
85+
node: 18.0.0
86+
- package: transaction-preview
87+
node: 16.13.1
88+
- package: zeal
89+
node: 16.13.1
90+
- package: phantom
91+
node: 16.13.1
92+
- package: xdefi
93+
node: 16.13.1
94+
- package: infinity-wallet
95+
node: 16.13.1
96+
- package: taho
97+
node: 16.13.1
98+
- package: unstoppable-resolution
99+
node: 16.13.1
100+
- package: cede-store
101+
node: 16.13.1
102+
- package: arcana-auth
103+
node: 18.0.0
104+
- package: blocto
105+
node: 16.13.1
106+
- package: venly
107+
node: 18.18.2
108+
- package: bitget
109+
node: 16.13.1
110+
- package: bitkeep
111+
node: 16.13.1
112+
- package: metamask
113+
node: 18.18.2
114+
- package: solid
115+
node: 16.15.1
116+
- package: para
117+
node: 18.18.2
118+
- package: particle-network
119+
node: 18.0.0
120+
- package: finoaconnect
121+
node: 18.0.0
122+
- package: wagmi
123+
node: 18.0.0
124+
- package: passport
125+
node: 18.0.0
126+
- package: bloom
127+
node: 18.0.0
128+
- package: keplr
129+
node: 18.0.0
130+
131+
defaults:
132+
run:
133+
shell: bash
134+
working-directory: packages/${{ matrix.package }}
135+
136+
steps:
137+
- uses: actions/checkout@v4
138+
139+
- name: Use Node ${{ matrix.node }}
140+
uses: actions/setup-node@v4
141+
with:
142+
node-version: ${{ matrix.node }}
143+
registry-url: https://registry.npmjs.org/
144+
145+
# ────── only publish *alpha* versions ──────
146+
- id: version
147+
run: echo "v=$(node -p 'require(\"./package.json\").version')" >> "$GITHUB_OUTPUT"
148+
149+
- name: Skip non‑alpha builds on develop
150+
if: ${{ !contains(steps.version.outputs.v, '-alpha') }}
151+
run: echo "Not an alpha – skipping publish."
152+
# ───────────────────────────────────────────
153+
154+
- name: Cache Yarn
155+
uses: actions/cache@v3
156+
with:
157+
path: |
158+
~/.cache/yarn
159+
node_modules
160+
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
161+
162+
- name: Generate workspace lock‑file
163+
run: yarn generate-lock-entry >> yarn.lock
164+
165+
- name: Install dependencies
166+
run: yarn --immutable
167+
168+
- name: Type‑check & build
169+
run: |
170+
yarn type-check
171+
yarn build
172+
173+
- name: Publish to npm (next)
174+
if: contains(steps.version.outputs.v, '-alpha')
175+
run: npm publish --tag next --access public

0 commit comments

Comments
 (0)