Skip to content

Commit

Permalink
ci: fix windows release (#6236)
Browse files Browse the repository at this point in the history
* ci: cleanup

* winders

* lefix
  • Loading branch information
DaniPopes authored Nov 7, 2023
1 parent 86f3d18 commit 7d7bdfb
Showing 1 changed file with 38 additions and 34 deletions.
72 changes: 38 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
jobs:
prepare:
name: Prepare release
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
tag_name: ${{ steps.release_info.outputs.tag_name }}
Expand Down Expand Up @@ -66,78 +66,81 @@ jobs:
uses: ./.github/workflows/docker-publish.yml

release:
name: ${{ matrix.job.target }} (${{ matrix.job.os }})
runs-on: ${{ matrix.job.os }}
timeout-minutes: 60
name: ${{ matrix.target }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 90
needs: prepare
strategy:
fail-fast: false
matrix:
job:
# The OS is used for the runner
# The platform is a generic platform name
# The target is used by Cargo
# The arch is either 386, arm64 or amd64
# The svm target platform to use for the binary https://github.com/roynalnaruto/svm-rs/blob/84cbe0ac705becabdc13168bae28a45ad2299749/svm-builds/build.rs#L4-L24
include:
# `os`: GHA runner
# `target`: Rust build target triple
# `platform` and `arch`: Used in tarball names
# `svm`: target platform to use for the Solc binary: https://github.com/roynalnaruto/svm-rs/blob/84cbe0ac705becabdc13168bae28a45ad2299749/svm-builds/build.rs#L4-L24
- os: ubuntu-20.04
platform: linux
target: x86_64-unknown-linux-gnu
arch: amd64
svm_target_platform: linux-amd64
- os: ubuntu-20.04
platform: linux
arch: amd64
- os: ubuntu-20.04
target: aarch64-unknown-linux-gnu
arch: arm64
svm_target_platform: linux-aarch64
platform: linux
arch: arm64
- os: macos-latest
platform: darwin
target: x86_64-apple-darwin
arch: amd64
svm_target_platform: macosx-amd64
- os: macos-latest
platform: darwin
arch: amd64
- os: macos-latest
target: aarch64-apple-darwin
arch: arm64
svm_target_platform: macosx-aarch64
platform: darwin
arch: arm64
- os: windows-latest
platform: win32
target: x86_64-pc-windows-msvc
arch: amd64
svm_target_platform: windows-amd64

platform: win32
arch: amd64
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.job.target }}
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Apple M1 setup
if: ${{ matrix.job.target == 'aarch64-apple-darwin' }}
if: matrix.target == 'aarch64-apple-darwin'
run: |
echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV
- name: Linux ARM setup
if: ${{ matrix.job.target == 'aarch64-unknown-linux-gnu' }}
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update -y
sudo apt-get install -y gcc-aarch64-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Build binaries
env:
SVM_TARGET_PLATFORM: ${{ matrix.job.svm_target_platform }}
run: cargo build --release --bins --target ${{ matrix.job.target }}
SVM_TARGET_PLATFORM: ${{ matrix.svm_target_platform }}
shell: bash
# Windows runs out of RAM when building binaries with LLVM
run: |
flags=()
[[ "${{ matrix.target }}" == *windows* ]] && flags+="-j2"
cargo build --release --bins --target ${{ matrix.target }} "${flags[@]}"
- name: Archive binaries
id: artifacts
env:
PLATFORM_NAME: ${{ matrix.job.platform }}
TARGET: ${{ matrix.job.target }}
ARCH: ${{ matrix.job.arch }}
PLATFORM_NAME: ${{ matrix.platform }}
TARGET: ${{ matrix.target }}
ARCH: ${{ matrix.arch }}
VERSION_NAME:
${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }}
shell: bash
Expand All @@ -159,10 +162,10 @@ jobs:
- name: Build man page
id: man
if: ${{ matrix.job.target == 'x86_64-unknown-linux-gnu' }}
if: matrix.target == 'x86_64-unknown-linux-gnu'
env:
PLATFORM_NAME: ${{ matrix.job.platform }}
TARGET: ${{ matrix.job.target }}
PLATFORM_NAME: ${{ matrix.platform }}
TARGET: ${{ matrix.target }}
VERSION_NAME:
${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }}
shell: bash
Expand Down Expand Up @@ -207,9 +210,10 @@ jobs:
cleanup:
name: Release cleanup
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
timeout-minutes: 30
needs: release
if: always()
steps:
- uses: actions/checkout@v3

Expand All @@ -234,7 +238,7 @@ jobs:
name: Open an issue
runs-on: ubuntu-latest
needs: [prepare, release-docker, release, cleanup]
if: ${{ failure() }}
if: failure()
steps:
- uses: actions/checkout@v3
- uses: JasonEtco/create-an-issue@v2
Expand Down

0 comments on commit 7d7bdfb

Please sign in to comment.