fix(release): munually use docker to build with multi-arch glibc (#649)
This commit is contained in:
parent
4917f0966c
commit
b757b1971e
29
.github/workflows/release.yaml
vendored
29
.github/workflows/release.yaml
vendored
@ -56,11 +56,13 @@ jobs:
|
|||||||
os_name: linux
|
os_name: linux
|
||||||
arch: x86_64
|
arch: x86_64
|
||||||
rust_target: x86_64-unknown-linux-gnu
|
rust_target: x86_64-unknown-linux-gnu
|
||||||
|
docker_platform: linux/amd64
|
||||||
container: quay.io/pypa/manylinux2014_x86_64 # for glibc 2.17
|
container: quay.io/pypa/manylinux2014_x86_64 # for glibc 2.17
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
os_name: linux
|
os_name: linux
|
||||||
arch: aarch64
|
arch: aarch64
|
||||||
rust_target: aarch64-unknown-linux-gnu
|
rust_target: aarch64-unknown-linux-gnu
|
||||||
|
docker_platform: linux/arm64
|
||||||
container: quay.io/pypa/manylinux2014_aarch64 # for glibc 2.17
|
container: quay.io/pypa/manylinux2014_aarch64 # for glibc 2.17
|
||||||
- os: macos-13
|
- os: macos-13
|
||||||
os_name: darwin
|
os_name: darwin
|
||||||
@ -80,10 +82,10 @@ jobs:
|
|||||||
rust_target: aarch64-pc-windows-msvc
|
rust_target: aarch64-pc-windows-msvc
|
||||||
|
|
||||||
runs-on: ${{ matrix.config.os }}
|
runs-on: ${{ matrix.config.os }}
|
||||||
container: ${{ matrix.config.container }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
if: ${{ matrix.config.os_name != 'linux' }}
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
if: ${{ matrix.config.os_name != 'linux' }}
|
if: ${{ matrix.config.os_name != 'linux' }}
|
||||||
- uses: dtolnay/rust-toolchain@master
|
- uses: dtolnay/rust-toolchain@master
|
||||||
@ -95,18 +97,18 @@ jobs:
|
|||||||
if: ${{ matrix.config.os_name != 'linux' }}
|
if: ${{ matrix.config.os_name != 'linux' }}
|
||||||
run: |
|
run: |
|
||||||
cargo build --release --features ${{ matrix.feature }}
|
cargo build --release --features ${{ matrix.feature }}
|
||||||
- uses: actions/checkout@v1 # for glibc 2.17
|
|
||||||
if: ${{ matrix.config.os_name == 'linux' }}
|
- name: Build all crates with glibc 2.17 # for glibc 2.17
|
||||||
- name: Install rust # for glibc 2.17
|
|
||||||
if: ${{ matrix.config.os_name == 'linux' }}
|
if: ${{ matrix.config.os_name == 'linux' }}
|
||||||
run: |
|
run: |
|
||||||
yum install -y openssl-devel
|
docker run \
|
||||||
curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
|
--rm \
|
||||||
- name: Build all crates # for glibc 2.17
|
-v $(pwd):/workspace \
|
||||||
if: ${{ matrix.config.os_name == 'linux' }}
|
-w /workspace \
|
||||||
run: |
|
--platform ${{ matrix.config.docker_platform }} \
|
||||||
. "$HOME/.cargo/env"
|
${{ matrix.config.container }} \
|
||||||
cargo build --release --features ${{ matrix.feature }}
|
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 }}"
|
||||||
|
|
||||||
- name: Handle binaries
|
- name: Handle binaries
|
||||||
if: ${{ matrix.config.os_name != 'windows' }}
|
if: ${{ matrix.config.os_name != 'windows' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -123,6 +125,7 @@ jobs:
|
|||||||
|
|
||||||
cd results
|
cd results
|
||||||
tar zcvf avante_lib-${{ matrix.config.os_name }}-${{ matrix.config.arch }}-${{ matrix.feature }}.tar.gz *.${EXT}
|
tar zcvf avante_lib-${{ matrix.config.os_name }}-${{ matrix.config.arch }}-${{ matrix.feature }}.tar.gz *.${EXT}
|
||||||
|
|
||||||
- name: Handle binaries (Windows)
|
- name: Handle binaries (Windows)
|
||||||
if: ${{ matrix.config.os_name == 'windows' }}
|
if: ${{ matrix.config.os_name == 'windows' }}
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
@ -139,7 +142,7 @@ jobs:
|
|||||||
Compress-Archive -Path $dllFiles -DestinationPath "avante_lib-${{ matrix.config.os_name }}-${{ matrix.config.arch }}-${{ matrix.feature }}.zip"
|
Compress-Archive -Path $dllFiles -DestinationPath "avante_lib-${{ matrix.config.os_name }}-${{ matrix.config.arch }}-${{ matrix.feature }}.zip"
|
||||||
|
|
||||||
- name: Upload Release Asset
|
- name: Upload Release Asset
|
||||||
uses: shogo82148/actions-upload-release-asset@v1.6.6
|
uses: shogo82148/actions-upload-release-asset@v1
|
||||||
if: ${{ matrix.config.os_name != 'windows' }}
|
if: ${{ matrix.config.os_name != 'windows' }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user