Skip to content

Commit fd7d118

Browse files
ci(release): Build Linux binaries natively
This matches the behavior of the build process for macOS and Windows binaries. Previously the Linux binaries were built in a Docker container, but we can likely simplify that process, and build directly on the runner.
1 parent 873937a commit fd7d118

File tree

2 files changed

+23
-43
lines changed

2 files changed

+23
-43
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,44 @@ jobs:
1313
include:
1414
- arch: i686
1515
target: i686-unknown-linux-musl
16-
container: i686-musl
1716
- arch: x86_64
1817
target: x86_64-unknown-linux-musl
19-
container: x86_64-musl
2018
- arch: armv7
2119
target: armv7-unknown-linux-musleabi
22-
container: armv7-musleabi
2320
- arch: aarch64
2421
target: aarch64-unknown-linux-musl
25-
container: aarch64-musl
2622

2723
name: Linux ${{ matrix.arch }}
2824
runs-on: ubuntu-24.04
2925

3026
steps:
3127
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
3228

33-
- name: Build in Docker
34-
run: scripts/build-in-docker.sh
35-
env:
36-
TARGET: ${{ matrix.target }}
37-
DOCKER_TAG: ${{ matrix.container }}
29+
- name: Install musl and cross-compilation tools
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install -y musl-tools
33+
# Install target-specific cross-compilation toolchains
34+
case "${{ matrix.target }}" in
35+
"armv7-unknown-linux-musleabi")
36+
sudo apt-get install -y gcc-arm-linux-gnueabihf
37+
;;
38+
"aarch64-unknown-linux-musl")
39+
sudo apt-get install -y gcc-aarch64-linux-gnu
40+
;;
41+
esac
42+
43+
- name: Add Rustup Target
44+
run: rustup target add ${{ matrix.target }}
45+
46+
- name: Cache Dependencies
47+
uses: swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # 2.8.0
48+
49+
- name: Build Binary
50+
run: cargo build --target=${{ matrix.target }} --release --locked
3851

3952
- name: Rename Binary
40-
run: mv target/*/release/sentry-cli sentry-cli-Linux-${{ matrix.arch }}
53+
run: mv target/${{ matrix.target }}/release/sentry-cli sentry-cli-Linux-${{ matrix.arch }}
4154

4255
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2
4356
with:

scripts/build-in-docker.sh

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)