Skip to content

Commit 3e2818d

Browse files
Merge pull request #105 from tronprotocol/release_0.8.26
Release 0.8.26
2 parents b018bcd + 17922ad commit 3e2818d

File tree

5 files changed

+298
-0
lines changed

5 files changed

+298
-0
lines changed

.github/workflows/build.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
ROOTDIR="$(dirname "$0")/../.."
5+
# shellcheck source=scripts/common.sh
6+
source "${ROOTDIR}/scripts/common.sh"
7+
8+
cd "${ROOTDIR}"
9+
10+
# Build release version
11+
echo -n >prerelease.txt
12+
13+
mkdir -p build
14+
cd build
15+
16+
# shellcheck disable=SC2086
17+
cmake .. -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" $CMAKE_OPTIONS -G "Unix Makefiles"
18+
19+
make

.github/workflows/build.yml

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
name: Build binaries on multi platform
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
- "release_*"
7+
8+
jobs:
9+
b_windows:
10+
runs-on: [ self-hosted, Windows ]
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v5
15+
16+
- name: Cache dependencies
17+
id: cache-deps
18+
uses: actions/cache@v4
19+
with:
20+
path: .\deps
21+
key: dependencies-win-${{ runner.arch }}-${{ hashFiles('scripts/install_deps.ps1') }}
22+
restore-keys: dependencies-win-${{ runner.arch }}-
23+
24+
- name: Installing dependencies
25+
if: steps.cache-deps.outputs.cache-hit != 'true'
26+
shell: powershell
27+
run: .\scripts\install_deps.ps1
28+
29+
- name: Run build script
30+
shell: bash
31+
run: powershell.exe .github/workflows/build_win.ps1
32+
33+
- name: Prepare artifact for caching
34+
shell: bash
35+
run: |
36+
mkdir github/
37+
cp build/solc/Release/solc.exe github/solc-windows.exe
38+
39+
- name: Save artifact to cache
40+
uses: actions/cache/save@v4
41+
with:
42+
path: github/solc-windows.exe
43+
key: solc-windows-${{ github.run_id }}
44+
enableCrossOsArchive: true
45+
46+
b_macos:
47+
runs-on: [ self-hosted, macOS ]
48+
49+
env:
50+
CMAKE_BUILD_TYPE: Release
51+
CMAKE_OPTIONS: -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64;arm64
52+
TERM: xterm
53+
MAKEFLAGS: -j5
54+
CPUs: 5
55+
56+
steps:
57+
- name: Checkout code
58+
uses: actions/checkout@v5
59+
60+
- name: Run build script
61+
shell: bash -el {0}
62+
run: .github/workflows/build.sh
63+
64+
- name: Prepare artifact for caching
65+
run: |
66+
mkdir github/
67+
cp build/solc/solc github/solc-macos
68+
69+
- name: Save artifact to cache
70+
uses: actions/cache/save@v4
71+
with:
72+
path: github/solc-macos
73+
key: solc-macos-${{ github.run_id }}
74+
enableCrossOsArchive: true
75+
76+
b_linux:
77+
runs-on: [ self-hosted, Linux, for-linux ]
78+
79+
env:
80+
CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -DUSE_Z3_DLOPEN=ON -DUSE_CVC4=OFF -DSOLC_STATIC_STDLIBS=ON
81+
MAKEFLAGS: -j 10
82+
CPUs: 10
83+
84+
container:
85+
image: solbuildpackpusher/solidity-buildpack-deps@sha256:84a1fb8771236e8d9aa5c615a425b8929e56a6e4f150a60078c8d74a1ceaa6c2
86+
87+
steps:
88+
- name: Checkout code
89+
uses: actions/checkout@v5
90+
91+
- name: Fix git safe directory
92+
run: git config --global --add safe.directory '*'
93+
94+
- name: Run build script
95+
run: .github/workflows/build.sh
96+
97+
- name: Prepare artifact for caching
98+
run: |
99+
mkdir github/
100+
cp build/solc/solc github/solc-static-linux
101+
102+
- name: Save artifact to cache
103+
uses: actions/cache/save@v4
104+
with:
105+
path: github/solc-static-linux
106+
key: solc-linux-${{ github.run_id }}
107+
108+
b_ems:
109+
runs-on: [ self-hosted, Linux, for-ems ]
110+
111+
env:
112+
MAKEFLAGS: -j 10
113+
CPUs: 5
114+
115+
container:
116+
image: solbuildpackpusher/solidity-buildpack-deps@sha256:c57f2bfb8c15d70fe290629358dd1c73dc126e3760f443b54764797556b887d4
117+
118+
steps:
119+
- name: Checkout code
120+
uses: actions/checkout@v5
121+
122+
- name: Fix git safe directory
123+
run: git config --global --add safe.directory '*'
124+
125+
- name: Run build script
126+
run: .github/workflows/build_ems.sh
127+
128+
- name: Prepare artifact for caching
129+
run: |
130+
mkdir github/
131+
cp upload/soljson.js github/soljson.js
132+
133+
- name: Save artifact to cache
134+
uses: actions/cache/save@v4
135+
with:
136+
path: github/soljson.js
137+
key: solc-ems-${{ github.run_id }}
138+
139+
upload-to-s3:
140+
needs: [ b_windows, b_macos, b_linux, b_ems ]
141+
142+
runs-on: [ self-hosted, macOS ]
143+
144+
permissions:
145+
actions: read
146+
contents: read
147+
148+
steps:
149+
- name: Restore solc-windows
150+
uses: actions/cache/restore@v4
151+
with:
152+
path: github/solc-windows.exe
153+
key: solc-windows-${{ github.run_id }}
154+
enableCrossOsArchive: true
155+
156+
- name: Restore solc-macos
157+
uses: actions/cache/restore@v4
158+
with:
159+
path: github/solc-macos
160+
key: solc-macos-${{ github.run_id }}
161+
enableCrossOsArchive: true
162+
163+
- name: Restore solc-linux
164+
uses: actions/cache/restore@v4
165+
with:
166+
path: github/solc-static-linux
167+
key: solc-linux-${{ github.run_id }}
168+
169+
- name: Restore solc-ems
170+
uses: actions/cache/restore@v4
171+
with:
172+
path: github/soljson.js
173+
key: solc-ems-${{ github.run_id }}
174+
175+
- name: List all artifacts
176+
run: |
177+
ls -R github/
178+
179+
- name: Create tarball for use on github
180+
run: |
181+
cd github
182+
tar --create --file ../github-binaries.tar *
183+
184+
- name: Rename binaries to solc-bin naming convention
185+
run: |
186+
full_version=$(
187+
github/solc-macos --version |
188+
sed -En 's/^Version: ([0-9.]+.*\+commit\.[0-9a-f]+(\.mod)?).*$/\1/p'
189+
)
190+
191+
mkdir -p solc-bin/{linux-amd64,macosx-amd64,windows-amd64,bin}
192+
193+
cp github/solc-static-linux "solc-bin/linux-amd64/solc-linux-amd64-v${full_version}"
194+
cp github/solc-macos "solc-bin/macosx-amd64/solc-macosx-amd64-v${full_version}"
195+
cp github/solc-windows.exe "solc-bin/windows-amd64/solc-windows-amd64-v${full_version}.exe"
196+
cp github/soljson.js "solc-bin/bin/soljson-v${full_version}.js"
197+
198+
cd solc-bin/
199+
tar --create --file ../solc-bin-binaries.tar *
200+
201+
- name: Upload to S3
202+
shell: zsh -el {0}
203+
env:
204+
S3_BUCKET_PROD: ${{ secrets.S3_BUCKET_PROD }}
205+
S3_BUCKET_TEST: ${{ secrets.S3_BUCKET_TEST }}
206+
run: |
207+
case "${GITHUB_REF_NAME}" in
208+
develop) bucket="${S3_BUCKET_PROD}" ;;
209+
release_*) bucket="${S3_BUCKET_TEST}" ;;
210+
esac
211+
212+
aws s3 cp github-binaries.tar "s3://${bucket}/${{ github.sha }}/" --only-show-errors
213+
aws s3 cp solc-bin-binaries.tar "s3://${bucket}/${{ github.sha }}/" --only-show-errors
214+
215+
cd github
216+
aws s3 cp solc-windows.exe "s3://${bucket}/${{ github.sha }}/" --only-show-errors
217+
aws s3 cp solc-macos "s3://${bucket}/${{ github.sha }}/" --only-show-errors
218+
aws s3 cp solc-static-linux "s3://${bucket}/${{ github.sha }}/" --only-show-errors
219+
aws s3 cp soljson.js "s3://${bucket}/${{ github.sha }}/" --only-show-errors
220+
221+
cd .. && rm -rf github solc-bin *.tar

.github/workflows/build_ems.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
set -ev
3+
4+
ROOTDIR="$(dirname "$0")/../.."
5+
# shellcheck source=scripts/common.sh
6+
source "${ROOTDIR}/scripts/common.sh"
7+
8+
cd "${ROOTDIR}"
9+
10+
# Build release version
11+
echo -n >prerelease.txt
12+
13+
# Disable warnings for unqualified `move()` calls, introduced and enabled by
14+
# default in clang-16 which is what the emscripten docker image uses.
15+
# Additionally, disable the warning for unknown warnings here, as this script is
16+
# also used with earlier clang versions.
17+
# TODO: This can be removed if and when all usages of `move()` in our codebase use the `std::` qualifier.
18+
CMAKE_CXX_FLAGS="-Wno-unqualified-std-cast-call"
19+
20+
mkdir -p build
21+
cd build
22+
emcmake cmake \
23+
-DCMAKE_BUILD_TYPE=Release \
24+
-DBoost_USE_STATIC_LIBS=1 \
25+
-DBoost_USE_STATIC_RUNTIME=1 \
26+
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" \
27+
-DTESTS=0 \
28+
..
29+
make soljson
30+
31+
cd ..
32+
mkdir -p upload
33+
scripts/ci/pack_soljson.sh "build/libsolc/soljson.js" "build/libsolc/soljson.wasm" upload/soljson.js
34+
cp upload/soljson.js ./
35+
36+
OUTPUT_SIZE=$(ls -la soljson.js)
37+
38+
echo "Emscripten output size: $OUTPUT_SIZE"

.github/workflows/build_win.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
$ErrorActionPreference = "Stop"
2+
3+
cd "$PSScriptRoot\..\.."
4+
5+
New-Item prerelease.txt -type file
6+
Write-Host "Building release version."
7+
8+
mkdir build
9+
cd build
10+
$boost_dir=(Resolve-Path $PSScriptRoot\..\..\deps\boost\lib\cmake\Boost-*)
11+
..\deps\cmake\bin\cmake -G "Visual Studio 17 2022" -DBoost_DIR="$boost_dir\" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_INSTALL_PREFIX="$PSScriptRoot\..\..\upload" -DUSE_Z3=OFF ..
12+
if ( -not $? ) { throw "CMake configure failed." }
13+
msbuild solidity.sln /p:Configuration=Release /m:10 /v:minimal
14+
if ( -not $? ) { throw "Build failed." }
15+
..\deps\cmake\bin\cmake --build . -j 10 --target install --config Release
16+
if ( -not $? ) { throw "Install target failed." }

.github/workflows/welcome-external-pr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
types:
66
- opened
77

8+
permissions:
9+
pull-requests: write
10+
contents: read
11+
812
env:
913
DRY_RUN: false
1014

0 commit comments

Comments
 (0)