-
Notifications
You must be signed in to change notification settings - Fork 79
206 lines (190 loc) · 6.86 KB
/
ci.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: Substrate Connect CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: write
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/turbo-build
with:
node-version: ${{ matrix.node-version }}
playwright-test-extension:
needs: [build]
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/turbo-build
- name: Build extension with Manifest v3 for Chrome
run: pnpm build:chrome
working-directory: ./projects/extension
- run: pnpm playwright:install
working-directory: ./projects/extension
- name: Test projects/extension
run: pnpm playwright:chromium --trace on
working-directory: ./projects/extension
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report-substrate-connect-extension-mv3-chrome
path: ./projects/extension/playwright-report
playwright-test-examples:
needs: [build]
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/turbo-build
- run: pnpm playwright:install
working-directory: ./examples/light-client-extension-helpers-extension
- name: Test examples/light-client-extension-helpers-extension
run: pnpm playwright:chromium --trace on
working-directory: ./examples/light-client-extension-helpers-extension
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report-light-client-extension-helpers-extension-mv3-chrome
path: ./examples/light-client-extension-helpers-extension/playwright-report
playwright-test-wallet-template:
needs: [build]
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/turbo-build
- name: Build extension with Manifest v3 for Chrome
run: pnpm build:chrome
working-directory: ./projects/wallet-template
- run: pnpm playwright:install
working-directory: ./projects/wallet-template
- name: Test projects/wallet-template
run: pnpm playwright:chromium --trace on
working-directory: ./projects/wallet-template
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report-substrate-connect-wallet-template-mv3-chrome
path: ./projects/wallet-template/playwright-report
changesets:
if: github.ref == 'refs/heads/main'
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/turbo-build
- name: Create Release Pull Request
uses: changesets/action@v1
with:
commit: "chore: version packages"
title: "chore: version packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
npm-publish:
if: github.ref == 'refs/heads/main'
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/turbo-build
- name: "@substrate/connect Publish"
id: publish_connect
uses: ./.github/actions/publish-package
with:
token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}
tarball-name: "substrate-connect"
package-directory: ./packages/connect
- name: "@substrate/connect-extension-protocol Publish"
id: publish_connect_extension_protocol
uses: ./.github/actions/publish-package
with:
token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}
tarball-name: "substrate-connect-extension-protocol"
package-directory: ./packages/connect-extension-protocol
- name: "@substrate/connect-known-chains Publish"
uses: ./.github/actions/publish-package
with:
token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}
tarball-name: "substrate-connect-known-chains"
package-directory: ./packages/connect-known-chains
- name: "@substrate/light-client-extension-helpers Publish"
uses: ./.github/actions/publish-package
with:
token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}
tarball-name: "substrate-light-client-extension-helpers"
package-directory: ./packages/light-client-extension-helpers
- name: "@substrate/connect-discovery"
uses: ./.github/actions/publish-package
with:
token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}
tarball-name: "substrate-connect-discovery"
package-directory: ./packages/connect-discovery
- name: "@substrate/discovery"
uses: ./.github/actions/publish-package
with:
token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}
tarball-name: "substrate-discovery"
package-directory: ./packages/discovery
- name: "@substrate/smoldot-discovery"
uses: ./.github/actions/publish-package
with:
token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}
tarball-name: "substrate-smoldot-discovery"
package-directory: ./packages/smoldot-discovery
upload-extension-artifacts:
if: github.ref == 'refs/heads/main'
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/upload-artifact@v4
with:
name: substrate-connect-extension-source-code
path: ./projects/extension
- uses: ./.github/actions/turbo-build
- run: pnpm --filter @substrate/extension build:firefox
- uses: actions/upload-artifact@v4
with:
name: substrate-connect-extension-mv3-firefox
path: ./projects/extension/dist
- run: pnpm --filter @substrate/extension build:chrome
- uses: actions/upload-artifact@v4
with:
name: substrate-connect-extension-mv3-chrome
path: ./projects/extension/dist
docs:
if: github.ref == 'refs/heads/main'
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/turbo-build
- name: Generate API Docs
run: pnpm api-docs
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
all:
# This dummy job depends on all the mandatory checks. It succeeds if and only if all CI checks
# are successful.
needs: [build, playwright-test-extension, playwright-test-examples, playwright-test-wallet-template]
runs-on: ubuntu-latest
steps:
- run: echo Success