Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(release): use cargo-zigbuild to build for glibc 2.17 #660

Merged
merged 1 commit into from
Sep 28, 2024
Merged
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
feat(release): use cargo-zigbuild to build for glibc 2.17
  • Loading branch information
yetone committed Sep 28, 2024
commit c23088877498015aa13e937a5526f0bd2f2bd508
27 changes: 12 additions & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ jobs:
os_name: linux
arch: x86_64
rust_target: x86_64-unknown-linux-gnu
docker_platform: linux/amd64
container: quay.io/pypa/manylinux2014_x86_64 # for glibc 2.17
- os: ubuntu-latest
os_name: linux
arch: aarch64
Expand Down Expand Up @@ -85,28 +83,27 @@ jobs:
- uses: actions/checkout@v4

- uses: Swatinem/rust-cache@v2
if: ${{ matrix.config.container == null }}

- uses: dtolnay/rust-toolchain@master
if: ${{ matrix.config.container == null }}
with:
targets: ${{ matrix.config.rust_target }}
toolchain: 1.80.0

- name: Install cargo-zigbuild
if: ${{ matrix.config.os_name == 'linux' }}
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-zigbuild

- name: Build all crates
if: ${{ matrix.config.container == null }}
if: ${{ matrix.config.os_name != 'linux' }}
run: |
cargo build --release --features ${{ matrix.feature }}

- name: Build all crates with glibc 2.17 # for glibc 2.17
if: ${{ matrix.config.container != null }}
- name: Build all crates with glibc 2.17
if: ${{ matrix.config.os_name == 'linux' }}
run: |
# sudo apt-get install -y qemu qemu-user-static
docker run \
--rm \
-v $(pwd):/workspace \
-w /workspace \
--platform ${{ matrix.config.docker_platform }} \
${{ matrix.config.container }} \
bash -c "yum install -y openssl-devel && curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal && . /root/.cargo/env && cargo build --release --features ${{ matrix.feature }}"
cargo zigbuild --target ${{ matrix.config.rust_target }}.2.17 --release --features ${{ matrix.feature }}

- name: Handle binaries
if: ${{ matrix.config.os_name != 'windows' }}
Expand Down