Repository navigation
279 lines (231 loc) · 8.01 KB
/
Copy pathrelease-client.yml
File metadata and controls
279 lines (231 loc) · 8.01 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
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
name: Release Client Build
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+*
workflow_dispatch:
permissions:
contents: write
env:
RELEASE_TAG: ${{ github.ref_name }}
jobs:
checks-and-tests:
runs-on: [self-hosted, Linux, X64]
steps:
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Checkout the source code
uses: actions/checkout@v5
with:
submodules: true
- name: Install deps
run: sudo apt -y install protobuf-compiler
- name: Install & display rust toolchain
run: rustup show
- name: Check targets are installed correctly
run: rustup target list --installed
- name: Install cargo-nextest
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- name: Check all features compilation
run: cargo check --features try-runtime,runtime-benchmarks --locked
- name: Run all tests
run: make test-all
native-linux:
needs: checks-and-tests
runs-on: [self-hosted, Linux, X64]
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
# - aarch64-unknown-linux-gnu
steps:
- name: Checkout the source code
uses: actions/checkout@v5
with:
submodules: true
- name: Install deps
run: sudo apt -y install protobuf-compiler lld
- name: aarch64 setup
if: contains(matrix.target, 'aarch64')
shell: bash
run: |
sudo apt update
sudo apt install -y gcc-multilib g++-multilib
sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
mkdir -p .cargo
touch .cargo/config
printf '[target.aarch64-unknown-linux-gnu]\nlinker = "aarch64-linux-gnu-gcc"' >> .cargo/config
- name: x86_64 setup
if: contains(matrix.target, 'x86_64')
run: |
mkdir -p .cargo
touch .cargo/config
printf '[target.x86_64-unknown-linux-gnu]\nrustflags = ["-Clink-arg=-fuse-ld=lld"]' >> .cargo/config
- name: Install & display rust toolchain
run: rustup show
- name: Add aarch64 target
if: contains(matrix.target, 'aarch64')
run: rustup target add ${{ matrix.target }}
- name: Check targets are installed correctly
run: rustup target list --installed
- name: Build optimized binary
run: cargo build --profile production --target ${{ matrix.target }} --locked --bin astar-collator
- name: Set artifact name
env:
TARGET: ${{ matrix.target }}
id: artifact-name
run: echo "name=astar-ubuntu-latest-${TARGET%%-*}" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v7
with:
name: ${{ steps.artifact-name.outputs.name }}
path: target/${{ matrix.target }}/production/astar-collator
docker:
needs: native-linux
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v5
with:
submodules: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v6
with:
images: staketechnologies/astar-collator
tags: |
type=raw,value=latest
type=raw,value=${{ github.ref_name }}
type=sha,format=short
- name: Download pre-built linux collator binary
uses: actions/download-artifact@v7
with:
name: astar-ubuntu-latest-x86_64
- name: Make binary executable and copy it to docker folder
run: chmod +x astar-collator && cp astar-collator third-party/docker
- name: Build & Push docker image
uses: docker/build-push-action@v7
with:
context: third-party/docker
platforms: linux/amd64
labels: ${{ steps.docker_meta.outputs.labels }}
tags: ${{ steps.docker_meta.outputs.tags }}
push: true
publish-release-draft:
needs: [native-linux, docker]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Use Node.js 24.x
uses: actions/setup-node@v6
with:
node-version: 24.x
- name: Get the latest client release
id: latest-release
# We're making an assumption that the latest client release will be within the last 30 releases
run: |
latest_client_tag=$(curl -s https://api.github.com/repos/AstarNetwork/Astar/releases | \
jq -r 'map(select(.name | test("^v\\d+\\.\\d+\\.\\d+$"; "i")))[0] | .tag_name')
echo "latest_client_tag=$latest_client_tag" >> $GITHUB_OUTPUT
- name: Generate Release Body
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: generate-release-body
run: |
cd .github/scripts
yarn
yarn -s run ts-node generate-release-body.ts generate \
--owner "${{ github.repository_owner }}" \
--repo "$(basename ${{ github.repository }})" \
--from "${{ steps.latest-release.outputs.latest_client_tag }}" \
--to "${{ github.ref_name }}" \
--type client \
> ../../body.md
- name: Create Release Draft
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "$RELEASE_TAG" \
--draft \
--title "$RELEASE_TAG" \
--notes-file body.md
upload-binaries:
needs: publish-release-draft
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- name: Download pre-built collator binary
uses: actions/download-artifact@v7
with:
name: astar-ubuntu-latest-x86_64
path: bin
- name: Make binary executable and tar gzip
run: |
cd bin
chmod +x astar-collator
tar zcvf astar-collator.tar.gz astar-collator
- name: Upload binary artifact
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
asset_name="astar-collator-${RELEASE_TAG}-ubuntu-x86_64.tar.gz"
mv bin/astar-collator.tar.gz "bin/$asset_name"
gh release upload "$RELEASE_TAG" "bin/$asset_name"
chain-sync-smoke:
needs: native-linux
runs-on: ubuntu-latest
strategy:
matrix:
chain: ["astar", "shiden", "shibuya"]
steps:
- name: Checkout the source code
uses: actions/checkout@v5
- name: Download pre-built collator binary
uses: actions/download-artifact@v7
with:
name: astar-ubuntu-latest-x86_64
path: target/release
- name: Sync chain ${{ matrix.chain }}
run: |
chmod +x target/release/astar-collator
./scripts/sync-smoke.sh ${{ matrix.chain }}
zombienet-smoke:
needs: native-linux
runs-on: ubuntu-latest
strategy:
matrix:
chain: ["astar-dev", "shiden-dev", "shibuya-dev"]
steps:
- name: Checkout the source code
uses: actions/checkout@v5
- name: Download pre-built collator binary
uses: actions/download-artifact@v7
with:
name: astar-ubuntu-latest-x86_64
path: third-party/zombienet
- name: Setup
run: chmod +x third-party/zombienet/astar-collator
- name: Setup zombienet
working-directory: third-party/zombienet
run: ./setup.sh
- name: ${{ matrix.chain }} build blocks
working-directory: third-party/zombienet
env:
CHAIN: ${{ matrix.chain }}
run: zombienet -p native test smoke.zndsl