Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ prerelease_source="${1:-ga}"
cd "${ROOTDIR}"

# shellcheck disable=SC2166
if [ -n "$FORCE_RELEASE" -o "$(git tag --points-at HEAD 2>/dev/null)" == tv* ]
if [ "$GITHUB_REF_NAME" == "develop" ]
then
echo -n >prerelease.txt
else
Expand Down
56 changes: 41 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,22 @@ jobs:
shell: bash
run: powershell.exe .github/workflows/build_win.ps1

- name: Upload artifact
uses: actions/upload-artifact@v4
- name: Save artifact to cache
uses: actions/cache/save@v4
with:
name: solc-windows
path: build\solc\Release\solc.exe
key: solc-windows-${{ github.run_id }}

b_macos:
runs-on: [ self-hosted, macOS ]

env:
CMAKE_BUILD_TYPE: Release
CMAKE_OPTIONS: -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64;arm64
TERM: xterm
MAKEFLAGS: -j5
CPUs: 5

steps:
- name: Checkout code
uses: actions/checkout@v5
Expand All @@ -47,11 +54,11 @@ jobs:
shell: bash -el {0}
run: .github/workflows/build.sh

- name: Upload artifact
uses: actions/upload-artifact@v4
- name: Save artifact to cache
uses: actions/cache/save@v4
with:
name: solc-macos
path: build/solc/solc
key: solc-macos-${{ github.run_id }}

b_linux:
runs-on: [ self-hosted, Linux, for-linux ]
Expand All @@ -74,11 +81,11 @@ jobs:
- name: Run build script
run: .github/workflows/build.sh

- name: Upload artifact
uses: actions/upload-artifact@v4
- name: Save artifact to cache
uses: actions/cache/save@v4
with:
name: solc-linux
path: build/solc/solc
key: solc-linux-${{ github.run_id }}

b_ems:
runs-on: [ self-hosted, Linux, for-ems ]
Expand All @@ -100,20 +107,39 @@ jobs:
- name: Run build script
run: .github/workflows/build_ems.sh

- name: Upload artifact
uses: actions/upload-artifact@v4
- name: Save artifact to cache
uses: actions/cache/save@v4
with:
name: solc-ems
path: upload/soljson.js
key: solc-ems-${{ github.run_id }}

upload-to-s3:
needs: [ b_windows, b_macos, b_linux, b_ems ]
runs-on: [ self-hosted, Linux ]
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Restore solc-windows
uses: actions/cache/restore@v4
with:
path: artifacts/solc-windows/solc.exe
key: solc-windows-${{ github.run_id }}

- name: Restore solc-macos
uses: actions/cache/restore@v4
with:
path: artifacts/solc-macos/solc
key: solc-macos-${{ github.run_id }}

- name: Restore solc-linux
uses: actions/cache/restore@v4
with:
path: artifacts/solc-linux/solc
key: solc-linux-${{ github.run_id }}

- name: Restore solc-ems
uses: actions/cache/restore@v4
with:
path: artifacts
path: artifacts/solc-ems/soljson.js
key: solc-ems-${{ github.run_id }}

- name: List all artifacts
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_ems.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ prerelease_source="${1:-ga}"
cd "${ROOTDIR}"

# shellcheck disable=SC2166
if [[ -n "$FORCE_RELEASE" || "$(git tag --points-at HEAD 2>/dev/null)" == tv* ]]
if [ "$GITHUB_REF_NAME" == "develop" ]
then
echo -n >prerelease.txt
else
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/build_win.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@ $ErrorActionPreference = "Stop"

cd "$PSScriptRoot\..\.."

New-Item prerelease.txt -type file
Write-Host "Building release version."
if ($Env:GITHUB_REF_NAME -eq 'develop') {
New-Item prerelease.txt -type file
Write-Host "Building release version."
}
else {
# Use last commit date rather than build date to avoid ending up with builds for
# different platforms having different version strings (and therefore producing different bytecode)
# if the CI is triggered just before midnight.
$last_commit_timestamp = git log -1 --date=unix --format=%cd HEAD
$last_commit_date = (Get-Date -Date "1970-01-01 00:00:00Z").toUniversalTime().addSeconds($last_commit_timestamp).ToString("yyyy.M.d")
-join("ga.", $last_commit_date) | out-file -encoding ascii prerelease.txt
}

mkdir build
cd build
$boost_dir=(Resolve-Path $PSScriptRoot\..\..\deps\boost\lib\cmake\Boost-*)
Expand Down