Skip to content

Commit 7d7bdfb

Browse files
authored
ci: fix windows release (#6236)
* ci: cleanup * winders * lefix
1 parent 86f3d18 commit 7d7bdfb

File tree

1 file changed

+38
-34
lines changed

1 file changed

+38
-34
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
jobs:
1616
prepare:
1717
name: Prepare release
18-
runs-on: ubuntu-20.04
18+
runs-on: ubuntu-latest
1919
timeout-minutes: 30
2020
outputs:
2121
tag_name: ${{ steps.release_info.outputs.tag_name }}
@@ -66,78 +66,81 @@ jobs:
6666
uses: ./.github/workflows/docker-publish.yml
6767

6868
release:
69-
name: ${{ matrix.job.target }} (${{ matrix.job.os }})
70-
runs-on: ${{ matrix.job.os }}
71-
timeout-minutes: 60
69+
name: ${{ matrix.target }} (${{ matrix.os }})
70+
runs-on: ${{ matrix.os }}
71+
timeout-minutes: 90
7272
needs: prepare
7373
strategy:
7474
fail-fast: false
7575
matrix:
76-
job:
77-
# The OS is used for the runner
78-
# The platform is a generic platform name
79-
# The target is used by Cargo
80-
# The arch is either 386, arm64 or amd64
81-
# The svm target platform to use for the binary https://github.com/roynalnaruto/svm-rs/blob/84cbe0ac705becabdc13168bae28a45ad2299749/svm-builds/build.rs#L4-L24
76+
include:
77+
# `os`: GHA runner
78+
# `target`: Rust build target triple
79+
# `platform` and `arch`: Used in tarball names
80+
# `svm`: target platform to use for the Solc binary: https://github.com/roynalnaruto/svm-rs/blob/84cbe0ac705becabdc13168bae28a45ad2299749/svm-builds/build.rs#L4-L24
8281
- os: ubuntu-20.04
83-
platform: linux
8482
target: x86_64-unknown-linux-gnu
85-
arch: amd64
8683
svm_target_platform: linux-amd64
87-
- os: ubuntu-20.04
8884
platform: linux
85+
arch: amd64
86+
- os: ubuntu-20.04
8987
target: aarch64-unknown-linux-gnu
90-
arch: arm64
9188
svm_target_platform: linux-aarch64
89+
platform: linux
90+
arch: arm64
9291
- os: macos-latest
93-
platform: darwin
9492
target: x86_64-apple-darwin
95-
arch: amd64
9693
svm_target_platform: macosx-amd64
97-
- os: macos-latest
9894
platform: darwin
95+
arch: amd64
96+
- os: macos-latest
9997
target: aarch64-apple-darwin
100-
arch: arm64
10198
svm_target_platform: macosx-aarch64
99+
platform: darwin
100+
arch: arm64
102101
- os: windows-latest
103-
platform: win32
104102
target: x86_64-pc-windows-msvc
105-
arch: amd64
106103
svm_target_platform: windows-amd64
107-
104+
platform: win32
105+
arch: amd64
108106
steps:
109107
- uses: actions/checkout@v3
110108
- uses: dtolnay/rust-toolchain@stable
111109
with:
112-
targets: ${{ matrix.job.target }}
110+
targets: ${{ matrix.target }}
113111
- uses: Swatinem/rust-cache@v2
114112
with:
115113
cache-on-failure: true
116114

117115
- name: Apple M1 setup
118-
if: ${{ matrix.job.target == 'aarch64-apple-darwin' }}
116+
if: matrix.target == 'aarch64-apple-darwin'
119117
run: |
120118
echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV
121119
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV
122120
123121
- name: Linux ARM setup
124-
if: ${{ matrix.job.target == 'aarch64-unknown-linux-gnu' }}
122+
if: matrix.target == 'aarch64-unknown-linux-gnu'
125123
run: |
126124
sudo apt-get update -y
127125
sudo apt-get install -y gcc-aarch64-linux-gnu
128126
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
129127
130128
- name: Build binaries
131129
env:
132-
SVM_TARGET_PLATFORM: ${{ matrix.job.svm_target_platform }}
133-
run: cargo build --release --bins --target ${{ matrix.job.target }}
130+
SVM_TARGET_PLATFORM: ${{ matrix.svm_target_platform }}
131+
shell: bash
132+
# Windows runs out of RAM when building binaries with LLVM
133+
run: |
134+
flags=()
135+
[[ "${{ matrix.target }}" == *windows* ]] && flags+="-j2"
136+
cargo build --release --bins --target ${{ matrix.target }} "${flags[@]}"
134137
135138
- name: Archive binaries
136139
id: artifacts
137140
env:
138-
PLATFORM_NAME: ${{ matrix.job.platform }}
139-
TARGET: ${{ matrix.job.target }}
140-
ARCH: ${{ matrix.job.arch }}
141+
PLATFORM_NAME: ${{ matrix.platform }}
142+
TARGET: ${{ matrix.target }}
143+
ARCH: ${{ matrix.arch }}
141144
VERSION_NAME:
142145
${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }}
143146
shell: bash
@@ -159,10 +162,10 @@ jobs:
159162
160163
- name: Build man page
161164
id: man
162-
if: ${{ matrix.job.target == 'x86_64-unknown-linux-gnu' }}
165+
if: matrix.target == 'x86_64-unknown-linux-gnu'
163166
env:
164-
PLATFORM_NAME: ${{ matrix.job.platform }}
165-
TARGET: ${{ matrix.job.target }}
167+
PLATFORM_NAME: ${{ matrix.platform }}
168+
TARGET: ${{ matrix.target }}
166169
VERSION_NAME:
167170
${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }}
168171
shell: bash
@@ -207,9 +210,10 @@ jobs:
207210
208211
cleanup:
209212
name: Release cleanup
210-
runs-on: ubuntu-20.04
213+
runs-on: ubuntu-latest
211214
timeout-minutes: 30
212215
needs: release
216+
if: always()
213217
steps:
214218
- uses: actions/checkout@v3
215219

@@ -234,7 +238,7 @@ jobs:
234238
name: Open an issue
235239
runs-on: ubuntu-latest
236240
needs: [prepare, release-docker, release, cleanup]
237-
if: ${{ failure() }}
241+
if: failure()
238242
steps:
239243
- uses: actions/checkout@v3
240244
- uses: JasonEtco/create-an-issue@v2

0 commit comments

Comments
 (0)