Repository navigation
338 lines (277 loc) · 10.3 KB
/
Copy pathbuild.yml
File metadata and controls
338 lines (277 loc) · 10.3 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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
name: Build binaries on multi platform
on:
push:
branches:
- develop
- "release_*"
jobs:
b_windows:
runs-on: windows-2022
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: true
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v5
with:
path: |
.\deps\boost
.\deps\cmake
key: hosted-dependencies-win-v2-${{ runner.arch }}-${{ hashFiles('scripts/install_deps.ps1') }}
- name: Installing dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
shell: powershell
run: .\scripts\install_deps.ps1
- name: Run build script
shell: bash
run: powershell.exe .github/workflows/build_win.ps1
- name: Prepare artifact for caching
shell: bash
run: |
mkdir github/
cp build/solc/Release/solc.exe github/solc-windows.exe
- name: Upload Windows binary
uses: actions/upload-artifact@v6
with:
name: solc-windows
path: github/solc-windows.exe
if-no-files-found: error
b_macos:
runs-on: macos-15
env:
CMAKE_BUILD_TYPE: Release
CMAKE_OPTIONS: -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64;arm64 -DBoost_ROOT=${{ github.workspace }}/deps/boost -DBoost_NO_SYSTEM_PATHS=ON
TERM: xterm
MAKEFLAGS: -j 3
CPUs: 3
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: true
- name: Select pinned macOS toolchain
run: |
sudo xcode-select --switch /Applications/Xcode_16.4.app/Contents/Developer
bash .circleci/install_cmake.sh 3.29.3
xcodebuild -version
clang --version
cmake --version
- name: Cache universal Boost
id: cache-boost
uses: actions/cache@v5
with:
path: deps/boost
key: hosted-boost-macos-universal-1.84.0-xcode16.4-v1
- name: Build universal Boost
if: steps.cache-boost.outputs.cache-hit != 'true'
run: |
boost_version=1.84.0
boost_dir="boost_${boost_version//./_}"
boost_archive="${RUNNER_TEMP}/${boost_dir}.tar.bz2"
curl --fail --location --retry 3 \
"https://archives.boost.io/release/${boost_version}/source/${boost_dir}.tar.bz2" \
--output "${boost_archive}"
tar -xjf "${boost_archive}" -C "${RUNNER_TEMP}"
cd "${RUNNER_TEMP}/${boost_dir}"
./bootstrap.sh \
--with-toolset=clang \
--with-libraries=filesystem,program_options,system,test
./b2 -j 3 -d0 \
link=static \
variant=release \
threading=multi \
address-model=64 \
architecture=arm+x86 \
--prefix="${GITHUB_WORKSPACE}/deps/boost" \
install
- name: Run build script
shell: bash -el {0}
run: .github/workflows/build.sh
- name: Prepare artifact for caching
run: |
mkdir github/
cp build/solc/solc github/solc-macos
- name: Upload macOS binary
uses: actions/upload-artifact@v6
with:
name: solc-macos
path: github/solc-macos
if-no-files-found: error
b_linux:
runs-on: ubuntu-24.04
env:
CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -DSOLC_LINK_STATIC=ON
TERM: xterm
MAKEFLAGS: -j 4
CPUs: 4
container:
# ghcr.io/argotorg/solidity-buildpack-deps:ubuntu2404-6
image: ghcr.io/argotorg/solidity-buildpack-deps@sha256:c0412c53e59ce0c96bde4c08e7332ea12e4cadba9bbac829621947897fa21272
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: true
- name: Fix git safe directory
run: git config --global --add safe.directory '*'
- name: Run build script
run: .github/workflows/build.sh
- name: Prepare artifact for caching
run: |
mkdir github/
cp build/solc/solc github/solc-static-linux
- name: Upload Linux binary
uses: actions/upload-artifact@v6
with:
name: solc-linux
path: github/solc-static-linux
if-no-files-found: error
b_linux_arm:
runs-on: ubuntu-24.04-arm
env:
CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -DSOLC_LINK_STATIC=ON
TERM: xterm
MAKEFLAGS: -j 4
CPUs: 4
container:
# ghcr.io/argotorg/solidity-buildpack-deps:ubuntu2404.arm-1
image: ghcr.io/argotorg/solidity-buildpack-deps@sha256:6cdb928fa8743d0b5d515c2c489b8d545c541f2370af28d5d3a71532056a0f22
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: true
- name: Fix git safe directory
run: git config --global --add safe.directory '*'
- name: Run build script
run: .github/workflows/build.sh
- name: Prepare artifact for caching
run: |
mkdir github/
cp build/solc/solc github/solc-static-linux-arm
- name: Upload Linux ARM64 binary
uses: actions/upload-artifact@v6
with:
name: solc-linux-arm
path: github/solc-static-linux-arm
if-no-files-found: error
b_ems:
runs-on: ubuntu-24.04
env:
TERM: xterm
MAKEFLAGS: -j 4
CPUs: 4
container:
# ghcr.io/argotorg/solidity-buildpack-deps:emscripten-21
# NOTE: Keep in sync with the digest in scripts/build_emscripten.sh
image: ghcr.io/argotorg/solidity-buildpack-deps@sha256:fc53d68a4680ffa7d5f70164e13a903478964f15bcc07434d74833a05f4fbc19
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: true
- name: Fix git safe directory
run: git config --global --add safe.directory '*'
- name: Run build script
run: .github/workflows/build_ems.sh
- name: Prepare artifact for caching
run: |
mkdir github/
cp upload/soljson.js github/soljson.js
- name: Upload Emscripten binary
uses: actions/upload-artifact@v6
with:
name: solc-ems
path: github/soljson.js
if-no-files-found: error
upload-to-s3:
needs: [ b_windows, b_macos, b_linux, b_linux_arm, b_ems ]
runs-on: [ self-hosted, Linux, for-linux ]
permissions:
actions: read
contents: read
steps:
- name: Prepare artifact workspace
id: artifact-workspace
shell: bash
run: |
artifact_work_dir="${RUNNER_TEMP}/solidity-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
mkdir -p "${artifact_work_dir}/github"
echo "path=${artifact_work_dir}" >> "${GITHUB_OUTPUT}"
- name: Download solc-windows
uses: actions/download-artifact@v7
with:
name: solc-windows
path: ${{ steps.artifact-workspace.outputs.path }}/github
- name: Download solc-macos
uses: actions/download-artifact@v7
with:
name: solc-macos
path: ${{ steps.artifact-workspace.outputs.path }}/github
- name: Download solc-linux
uses: actions/download-artifact@v7
with:
name: solc-linux
path: ${{ steps.artifact-workspace.outputs.path }}/github
- name: Download solc-linux-arm
uses: actions/download-artifact@v7
with:
name: solc-linux-arm
path: ${{ steps.artifact-workspace.outputs.path }}/github
- name: Download solc-ems
uses: actions/download-artifact@v7
with:
name: solc-ems
path: ${{ steps.artifact-workspace.outputs.path }}/github
- name: Restore executable permissions
working-directory: ${{ steps.artifact-workspace.outputs.path }}
run: chmod +x github/solc-static-linux github/solc-static-linux-arm github/solc-macos
- name: List all artifacts
working-directory: ${{ steps.artifact-workspace.outputs.path }}
run: |
ls -R github/
- name: Create tarball for use on github
working-directory: ${{ steps.artifact-workspace.outputs.path }}
run: |
cd github
tar --create --file ../github-binaries.tar *
- name: Rename binaries to solc-bin naming convention
working-directory: ${{ steps.artifact-workspace.outputs.path }}
run: |
full_version=$(
github/solc-static-linux --version |
sed -En 's/^Version: ([0-9.]+.*\+commit\.[0-9a-f]+(\.mod)?).*$/\1/p'
)
mkdir -p solc-bin/{linux-amd64,linux-arm64,macosx-amd64,windows-amd64,bin}
cp github/solc-static-linux-arm "solc-bin/linux-arm64/solc-linux-arm64-v${full_version}"
cp github/solc-static-linux "solc-bin/linux-amd64/solc-linux-amd64-v${full_version}"
cp github/solc-macos "solc-bin/macosx-amd64/solc-macosx-amd64-v${full_version}"
cp github/solc-windows.exe "solc-bin/windows-amd64/solc-windows-amd64-v${full_version}.exe"
cp github/soljson.js "solc-bin/bin/soljson-v${full_version}.js"
cd solc-bin/
tar --create --file ../solc-bin-binaries.tar *
- name: Upload to S3
shell: bash
working-directory: ${{ steps.artifact-workspace.outputs.path }}
env:
S3_BUCKET: ${{ secrets.S3_BUCKET_PROD }}
run: |
aws s3 cp github-binaries.tar "s3://${S3_BUCKET}/${{ github.sha }}/" --only-show-errors
aws s3 cp solc-bin-binaries.tar "s3://${S3_BUCKET}/${{ github.sha }}/" --only-show-errors
cd github
aws s3 cp solc-windows.exe "s3://${S3_BUCKET}/${{ github.sha }}/" --only-show-errors
aws s3 cp solc-macos "s3://${S3_BUCKET}/${{ github.sha }}/" --only-show-errors
aws s3 cp solc-static-linux "s3://${S3_BUCKET}/${{ github.sha }}/" --only-show-errors
aws s3 cp solc-static-linux-arm "s3://${S3_BUCKET}/${{ github.sha }}/" --only-show-errors
aws s3 cp soljson.js "s3://${S3_BUCKET}/${{ github.sha }}/" --only-show-errors
- name: Clean artifact workspace
if: always()
shell: bash
env:
ARTIFACT_WORK_DIR: ${{ steps.artifact-workspace.outputs.path }}
run: |
if [[ -n "${ARTIFACT_WORK_DIR}" ]]; then
rm -rf -- "${ARTIFACT_WORK_DIR}"
fi