Skip to content

Commit 77f07b4

Browse files
author
Marc-André Moreau
committed
use cbake actions, deprecate ubuntu 20.04 runners
1 parent e76dc12 commit 77f07b4

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

.github/workflows/nuget-publish.yml

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ jobs:
6161
- os: osx
6262
runner: macos-14
6363
- os: linux
64-
runner: ubuntu-20.04
64+
runner: ubuntu-22.04
6565
- os: ios
6666
runner: macos-14
6767
- os: android
68-
runner: ubuntu-20.04
68+
runner: ubuntu-22.04
6969
exclude:
7070
- arch: arm
7171
os: win
@@ -160,15 +160,6 @@ jobs:
160160
if: ${{ matrix.os == 'linux' }}
161161
run: sudo apt update
162162

163-
# We need a newer version of GCC because aws-lc-rs rejects versions affected
164-
# by this bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189
165-
# These lines can be safely removed once we switch to ubuntu-22.04 runner.
166-
- name: Install GCC 10.x
167-
if: ${{ matrix.os == 'linux' }}
168-
run: |
169-
sudo apt install gcc-10
170-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 60
171-
172163
- name: Install dependencies for rustls
173164
if: ${{ runner.os == 'Windows' }}
174165
shell: pwsh
@@ -199,6 +190,18 @@ jobs:
199190
if: ${{ matrix.os == 'android' }}
200191
run: sudo apt install gcc-multilib
201192

193+
- name: Setup LLVM
194+
uses: Devolutions/actions-public/setup-llvm@cbake
195+
if: matrix.os == 'linux'
196+
with:
197+
version: "18.1.8"
198+
199+
- name: Setup CBake
200+
uses: Devolutions/actions-public/setup-cbake@cbake
201+
if: matrix.os == 'linux'
202+
with:
203+
cargo_env_scripts: true
204+
202205
- name: Build native lib (${{matrix.os}}-${{matrix.arch}})
203206
shell: pwsh
204207
run: |
@@ -226,12 +229,6 @@ jobs:
226229
$Env:RUSTFLAGS="-C target-feature=+crt-static"
227230
}
228231
229-
if ($RustTarget -eq 'aarch64-unknown-linux-gnu') {
230-
sudo apt update
231-
sudo apt install gcc-aarch64-linux-gnu
232-
$Env:RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc"
233-
}
234-
235232
$ProjectVersion = '${{ needs.preflight.outputs.project-version }}'
236233
$PackageVersion = '${{ needs.preflight.outputs.package-version }}'
237234
@@ -241,6 +238,13 @@ jobs:
241238
}
242239
Set-Content -Path .\ffi\Cargo.toml -Value $CargoToml
243240
241+
if ($DotNetOs -eq 'linux') {
242+
$LinuxArch = @{'x64'='amd64';'arm64'='arm64'}[$DotNetArch]
243+
$Env:SYSROOT_NAME = "ubuntu-20.04-$LinuxArch"
244+
. "$HOME/.cargo/cbake/${RustTarget}-enter.ps1"
245+
$Env:AWS_LC_SYS_CMAKE_BUILDER="true"
246+
}
247+
244248
$CargoParams = @(
245249
"build",
246250
"-p", "ffi",
@@ -276,13 +280,8 @@ jobs:
276280
- name: Checkout ${{ github.repository }}
277281
uses: actions/checkout@v4
278282

279-
- name: Configure runner
280-
shell: pwsh
281-
run: |
282-
wget -q https://github.com/awakecoding/llvm-prebuilt/releases/download/v2023.3.0/cctools-x86_64-ubuntu-22.04.tar.xz
283-
tar -xf cctools-x86_64-ubuntu-22.04.tar.xz -C /tmp
284-
sudo mv /tmp/cctools-x86_64-ubuntu-22.04/bin/lipo /usr/local/bin
285-
sudo mv /tmp/cctools-x86_64-ubuntu-22.04/bin/install_name_tool /usr/local/bin
283+
- name: Setup CCTools
284+
uses: Devolutions/actions-public/setup-cctools@cbake
286285

287286
- name: Download native components
288287
uses: actions/download-artifact@v4

0 commit comments

Comments
 (0)