mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Add matrix to rust builds
This commit is contained in:
12
.github/workflows/build-python.yml
vendored
12
.github/workflows/build-python.yml
vendored
@@ -22,11 +22,6 @@ jobs:
|
|||||||
- runner: ubuntu-22.04
|
- runner: ubuntu-22.04
|
||||||
target: ppc64le
|
target: ppc64le
|
||||||
steps:
|
steps:
|
||||||
- name: Install Dependencies
|
|
||||||
if: ${{ matrix.platform.runner == 'ubuntu-22.04-arm' }}
|
|
||||||
run: |
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@@ -56,6 +51,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: wheels-linux-${{ matrix.platform.target }}
|
name: wheels-linux-${{ matrix.platform.target }}
|
||||||
path: src/lib-python/dist
|
path: src/lib-python/dist
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
musllinux:
|
musllinux:
|
||||||
runs-on: ${{ matrix.platform.runner }}
|
runs-on: ${{ matrix.platform.runner }}
|
||||||
@@ -101,6 +97,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: wheels-musllinux-${{ matrix.platform.target }}
|
name: wheels-musllinux-${{ matrix.platform.target }}
|
||||||
path: src/lib-python/dist
|
path: src/lib-python/dist
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
runs-on: ${{ matrix.platform.runner }}
|
runs-on: ${{ matrix.platform.runner }}
|
||||||
@@ -148,6 +145,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: wheels-windows-${{ matrix.platform.target }}
|
name: wheels-windows-${{ matrix.platform.target }}
|
||||||
path: src/lib-python/dist
|
path: src/lib-python/dist
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
runs-on: ${{ matrix.platform.runner }}
|
runs-on: ${{ matrix.platform.runner }}
|
||||||
@@ -187,6 +185,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: wheels-macos-${{ matrix.platform.target }}
|
name: wheels-macos-${{ matrix.platform.target }}
|
||||||
path: src/lib-python/dist
|
path: src/lib-python/dist
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
sdist:
|
sdist:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -206,4 +205,5 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: wheels-sdist
|
name: wheels-sdist
|
||||||
path: src/lib-python/dist
|
path: src/lib-python/dist
|
||||||
|
retention-days: 1
|
||||||
|
|||||||
176
.github/workflows/build-rust.yml
vendored
176
.github/workflows/build-rust.yml
vendored
@@ -3,7 +3,7 @@ on:
|
|||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
windows:
|
windows-bins:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
env:
|
env:
|
||||||
RUSTFLAGS: -C target-feature=+crt-static
|
RUSTFLAGS: -C target-feature=+crt-static
|
||||||
@@ -17,53 +17,78 @@ jobs:
|
|||||||
rust-cache: true
|
rust-cache: true
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
rustup target add aarch64-pc-windows-msvc --toolchain nightly-x86_64-pc-windows-msvc
|
|
||||||
rustup component add rust-src --toolchain nightly-x86_64-pc-windows-msvc
|
rustup component add rust-src --toolchain nightly-x86_64-pc-windows-msvc
|
||||||
- name: Build Rust Binaries (x86)
|
- name: Build Rust Binaries
|
||||||
run: cargo +nightly build --target i686-win7-windows-msvc -Z build-std="core,alloc,std,panic_abort" --features windows --release -p velopack_bins
|
run: cargo +nightly build --target i686-win7-windows-msvc --features windows --release -Z build-std="core,alloc,std,panic_abort" -p velopack_bins
|
||||||
- name: Upload Rust Build Artifacts
|
- name: Upload Rust Build Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: rust-windows-latest
|
name: rust-windows-bins
|
||||||
path: |
|
path: |
|
||||||
target\i686-win7-windows-msvc\release\*.exe
|
target\i686-win7-windows-msvc\release\*.exe
|
||||||
target\i686-win7-windows-msvc\release\*.pdb
|
target\i686-win7-windows-msvc\release\*.pdb
|
||||||
- name: Build Rust (x86)
|
retention-days: 1
|
||||||
run: cargo +nightly build --target i686-win7-windows-msvc -Z build-std="core,alloc,std,panic_abort" --release -p velopack_nodeffi -p velopack_libc
|
|
||||||
- name: Build Rust (x64)
|
windows:
|
||||||
run: cargo +nightly build --target x86_64-win7-windows-msvc -Z build-std="core,alloc,std,panic_abort" --release -p velopack_nodeffi -p velopack_libc
|
runs-on: windows-latest
|
||||||
- name: Build Rust (arm64)
|
strategy:
|
||||||
run: cargo +nightly build --target aarch64-pc-windows-msvc --release -p velopack_nodeffi -p velopack_libc
|
fail-fast: false
|
||||||
- name: Collect Artifacts
|
matrix:
|
||||||
|
target: [x86, x64, arm64]
|
||||||
|
include:
|
||||||
|
- target: x86
|
||||||
|
rust_flags: --release -Z build-std="core,alloc,std,panic_abort"
|
||||||
|
rust_target: i686-win7-windows-msvc
|
||||||
|
- target: x64
|
||||||
|
rust_flags: --release -Z build-std="core,alloc,std,panic_abort"
|
||||||
|
rust_target: x86_64-win7-windows-msvc
|
||||||
|
- target: arm64
|
||||||
|
rust_flags: --release
|
||||||
|
rust_target: aarch64-pc-windows-msvc
|
||||||
|
env:
|
||||||
|
RUSTFLAGS: -C target-feature=+crt-static
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Setup Job Environment
|
||||||
|
uses: ./.github/actions/job-setup
|
||||||
|
with:
|
||||||
|
rust-cache: true
|
||||||
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
move target\i686-win7-windows-msvc\release\velopack_nodeffi.dll target\velopack_nodeffi_win_x86_msvc.node
|
rustup component add rust-src --toolchain nightly-x86_64-pc-windows-msvc
|
||||||
move target\x86_64-win7-windows-msvc\release\velopack_nodeffi.dll target\velopack_nodeffi_win_x64_msvc.node
|
rustup target add aarch64-pc-windows-msvc --toolchain nightly-x86_64-pc-windows-msvc
|
||||||
move target\aarch64-pc-windows-msvc\release\velopack_nodeffi.dll target\velopack_nodeffi_win_arm64_msvc.node
|
- name: Build Rust (${{ matrix.target }})
|
||||||
|
run: |
|
||||||
move target\i686-win7-windows-msvc\release\velopack_libc.dll target\velopack_libc_win_x86_msvc.dll
|
cargo +nightly build --target ${{ matrix.rust_target }} ${{ matrix.rust_flags }} -p velopack_nodeffi -p velopack_libc
|
||||||
move target\x86_64-win7-windows-msvc\release\velopack_libc.dll target\velopack_libc_win_x64_msvc.dll
|
move target\${{ matrix.rust_target }}\release\velopack_nodeffi.dll target\velopack_nodeffi_win_${{ matrix.target }}_msvc.node
|
||||||
move target\aarch64-pc-windows-msvc\release\velopack_libc.dll target\velopack_libc_win_arm64_msvc.dll
|
move target\${{ matrix.rust_target }}\release\velopack_libc.dll target\velopack_libc_win_${{ matrix.target }}_msvc.dll
|
||||||
|
move target\${{ matrix.rust_target }}\release\velopack_libc.dll.lib target\velopack_libc_win_${{ matrix.target }}_msvc.dll.lib
|
||||||
move target\i686-win7-windows-msvc\release\velopack_libc.dll.lib target\velopack_libc_win_x86_msvc.dll.lib
|
move target\${{ matrix.rust_target }}\release\velopack_libc.lib target\velopack_libc_win_${{ matrix.target }}_msvc.lib
|
||||||
move target\x86_64-win7-windows-msvc\release\velopack_libc.dll.lib target\velopack_libc_win_x64_msvc.dll.lib
|
|
||||||
move target\aarch64-pc-windows-msvc\release\velopack_libc.dll.lib target\velopack_libc_win_arm64_msvc.dll.lib
|
|
||||||
|
|
||||||
move target\i686-win7-windows-msvc\release\velopack_libc.lib target\velopack_libc_win_x86_msvc.lib
|
|
||||||
move target\x86_64-win7-windows-msvc\release\velopack_libc.lib target\velopack_libc_win_x64_msvc.lib
|
|
||||||
move target\aarch64-pc-windows-msvc\release\velopack_libc.lib target\velopack_libc_win_arm64_msvc.lib
|
|
||||||
- name: Upload Rust Build Artifacts
|
- name: Upload Rust Build Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: rust-windows-latest-libs
|
name: rust-windows-libs-${{ matrix.target }}
|
||||||
path: |
|
path: |
|
||||||
target\*.node
|
target\*.node
|
||||||
target\*.dll
|
target\*.dll
|
||||||
target\*.lib
|
target\*.lib
|
||||||
# - name: Cancel workflow if failed
|
retention-days: 1
|
||||||
# uses: andymckay/cancel-action@0.5
|
- name: Cancel workflow if failed
|
||||||
# if: ${{ failure() }}
|
uses: andymckay/cancel-action@0.5
|
||||||
|
if: ${{ failure() }}
|
||||||
|
|
||||||
linux:
|
linux-bins:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
target: [x64, arm64]
|
||||||
|
include:
|
||||||
|
- target: x64
|
||||||
|
rust_target: x86_64-unknown-linux-musl
|
||||||
|
- target: arm64
|
||||||
|
rust_target: aarch64-unknown-linux-musl
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -75,58 +100,66 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
||||||
cargo binstall cross
|
cargo binstall cross
|
||||||
|
mkdir ./artifacts
|
||||||
|
- name: Build Rust Binaries (${{ matrix.target }})
|
||||||
|
run: |
|
||||||
|
cross build --release --target ${{ matrix.rust_target }} -p velopack_bins
|
||||||
|
ldd ./target/${{ matrix.rust_target }}/release/update || true
|
||||||
|
cp ./target/${{ matrix.rust_target }}/release/update ./artifacts/UpdateNix_${{ matrix.target }}
|
||||||
|
- name: Upload Rust Build Artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: rust-ubuntu-bins-${{ matrix.target }}
|
||||||
|
path: |
|
||||||
|
artifacts/UpdateNix_${{ matrix.target }}
|
||||||
|
retention-days: 1
|
||||||
|
# - name: Cancel workflow if failed
|
||||||
|
# uses: andymckay/cancel-action@0.5
|
||||||
|
# if: ${{ failure() }}
|
||||||
|
|
||||||
|
linux:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
target: [x64, arm64]
|
||||||
|
include:
|
||||||
|
- target: x64
|
||||||
|
rust_target: x86_64-unknown-linux-gnu
|
||||||
|
- target: arm64
|
||||||
|
rust_target: aarch64-unknown-linux-gnu
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Setup Job Environment
|
||||||
|
uses: ./.github/actions/job-setup
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
rustup target add aarch64-unknown-linux-gnu
|
rustup target add aarch64-unknown-linux-gnu
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
|
sudo apt install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
|
||||||
mkdir ./artifacts
|
mkdir ./artifacts
|
||||||
# rustup target add x86_64-unknown-linux-musl
|
- name: Build Rust (${{ matrix.target }})
|
||||||
# rustup target add aarch64-unknown-linux-musl
|
|
||||||
# sudo apt install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu musl-tools musl:arm64
|
|
||||||
- name: Build Rust Binaries (x64)
|
|
||||||
run: |
|
|
||||||
cargo clean
|
|
||||||
cross build --release --target x86_64-unknown-linux-musl -p velopack_bins
|
|
||||||
ldd ./target/x86_64-unknown-linux-musl/release/update || true
|
|
||||||
cp ./target/x86_64-unknown-linux-musl/release/update ./artifacts/UpdateNix_x64
|
|
||||||
- name: Build Rust Binaries (arm64)
|
|
||||||
run: |
|
|
||||||
cargo clean
|
|
||||||
cross build --release --target aarch64-unknown-linux-musl -p velopack_bins
|
|
||||||
ldd ./target/aarch64-unknown-linux-musl/release/update || true
|
|
||||||
cp ./target/aarch64-unknown-linux-musl/release/update ./artifacts/UpdateNix_arm64
|
|
||||||
- name: Upload Rust Build Artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: rust-ubuntu-latest
|
|
||||||
path: |
|
|
||||||
artifacts/UpdateNix*
|
|
||||||
- name: Build Rust (x64)
|
|
||||||
run: |
|
|
||||||
cargo clean
|
|
||||||
cargo build --release --target x86_64-unknown-linux-gnu -p velopack_nodeffi -p velopack_libc
|
|
||||||
cp ./target/x86_64-unknown-linux-gnu/release/libvelopack_nodeffi.so ./artifacts/velopack_nodeffi_linux_x64_gnu.node
|
|
||||||
cp ./target/x86_64-unknown-linux-gnu/release/libvelopack_libc.so ./artifacts/velopack_libc_linux_x64_gnu.so
|
|
||||||
cp ./target/x86_64-unknown-linux-gnu/release/libvelopack_libc.a ./artifacts/velopack_libc_linux_x64_gnu.a
|
|
||||||
- name: Build Rust (arm64)
|
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
||||||
run: |
|
run: |
|
||||||
cargo clean
|
cargo build --release --target ${{ matrix.rust_target }} -p velopack_nodeffi -p velopack_libc
|
||||||
cargo build --release --target aarch64-unknown-linux-gnu -p velopack_nodeffi -p velopack_libc
|
cp ./target/${{ matrix.rust_target }}/release/libvelopack_nodeffi.so ./artifacts/velopack_nodeffi_linux_${{ matrix.target }}_gnu.node
|
||||||
cp ./target/aarch64-unknown-linux-gnu/release/libvelopack_nodeffi.so ./artifacts/velopack_nodeffi_linux_arm64_gnu.node
|
cp ./target/${{ matrix.rust_target }}/release/libvelopack_libc.so ./artifacts/velopack_libc_linux_${{ matrix.target }}_gnu.so
|
||||||
cp ./target/aarch64-unknown-linux-gnu/release/libvelopack_libc.so ./artifacts/velopack_libc_linux_arm64_gnu.so
|
cp ./target/${{ matrix.rust_target }}/release/libvelopack_libc.a ./artifacts/velopack_libc_linux_${{ matrix.target }}_gnu.a
|
||||||
cp ./target/aarch64-unknown-linux-gnu/release/libvelopack_libc.a ./artifacts/velopack_libc_linux_arm64_gnu.a
|
|
||||||
- name: Upload Rust Build Artifacts
|
- name: Upload Rust Build Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: rust-ubuntu-latest-libs
|
name: rust-ubuntu-libs-${{ matrix.target }}
|
||||||
path: |
|
path: |
|
||||||
artifacts/*.so
|
artifacts/*.so
|
||||||
artifacts/*.node
|
artifacts/*.node
|
||||||
artifacts/*.a
|
artifacts/*.a
|
||||||
- name: Cancel workflow if failed
|
retention-days: 1
|
||||||
uses: andymckay/cancel-action@0.5
|
# - name: Cancel workflow if failed
|
||||||
if: ${{ failure() }}
|
# uses: andymckay/cancel-action@0.5
|
||||||
|
# if: ${{ failure() }}
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
@@ -162,12 +195,13 @@ jobs:
|
|||||||
- name: Upload Rust Build Artifacts
|
- name: Upload Rust Build Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: rust-macos-latest
|
name: rust-macos
|
||||||
path: |
|
path: |
|
||||||
target/UpdateMac
|
target/UpdateMac
|
||||||
target/*.dylib
|
target/*.dylib
|
||||||
target/*.node
|
target/*.node
|
||||||
target/*.a
|
target/*.a
|
||||||
|
retention-days: 1
|
||||||
- name: Cancel workflow if failed
|
- name: Cancel workflow if failed
|
||||||
uses: andymckay/cancel-action@0.5
|
uses: andymckay/cancel-action@0.5
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
3
.github/workflows/build-tests.yml
vendored
3
.github/workflows/build-tests.yml
vendored
@@ -92,7 +92,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
max_wait_seconds: 900
|
max_wait_seconds: 900
|
||||||
artifacts: rust-macos-latest,rust-windows-latest,rust-ubuntu-latest
|
artifacts: rust-macos,rust-windows-bins,rust-ubuntu-bins-x64,rust-ubuntu-bins-arm64
|
||||||
verbose: true
|
verbose: true
|
||||||
- name: Download Rust Artifacts
|
- name: Download Rust Artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@@ -118,6 +118,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: cross-${{ matrix.os }}
|
name: cross-${{ matrix.os }}
|
||||||
path: test/artifacts/*
|
path: test/artifacts/*
|
||||||
|
retention-days: 1
|
||||||
- name: Upload Coverage
|
- name: Upload Coverage
|
||||||
uses: codecov/codecov-action@v5
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
with:
|
||||||
|
|||||||
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@@ -8,12 +8,12 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-python:
|
|
||||||
uses: ./.github/workflows/build-python.yml
|
|
||||||
|
|
||||||
build-rust:
|
build-rust:
|
||||||
uses: ./.github/workflows/build-rust.yml
|
uses: ./.github/workflows/build-rust.yml
|
||||||
|
|
||||||
|
build-python:
|
||||||
|
uses: ./.github/workflows/build-python.yml
|
||||||
|
|
||||||
build-tests:
|
build-tests:
|
||||||
uses: ./.github/workflows/build-tests.yml
|
uses: ./.github/workflows/build-tests.yml
|
||||||
secrets: inherit # tests need secrets to run
|
secrets: inherit # tests need secrets to run
|
||||||
|
|||||||
Reference in New Issue
Block a user