diff options
author | cyqsimon <28627918+cyqsimon@users.noreply.github.com> | 2024-04-16 14:39:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-16 14:39:35 +0800 |
commit | 3f649590f7b3b0b1ab07a1c49fd649860e423386 (patch) | |
tree | c59f0a1ff662aaffbd3db4aaed920e1bcd2fae32 | |
parent | d9fa0894a34374394ea21f9d2aa9c26574d1506a (diff) |
CI: Enable more cross-compiled builds (#401)
* CI: Enable more aarch64 builds
* Use cross for linux-aarch64-* builds
* Use `macos-14` explicitly for now
- https://github.com/orgs/community/discussions/116911
- https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/
* Add targets in release.yaml
* Write changelog
* Fix typo
* Passthrough `BANDWHICH_GEN_DIR` into cross container
* Add armv7 targets
-rw-r--r-- | .github/workflows/ci.yaml | 26 | ||||
-rw-r--r-- | .github/workflows/release.yaml | 47 | ||||
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | Cross.toml | 2 |
4 files changed, 63 insertions, 13 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 02d21e1..11027ba 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -58,8 +58,13 @@ jobs: matrix: build: - android-aarch64 + - linux-aarch64-gnu + - linux-aarch64-musl + - linux-armv7-gnueabihf + - linux-armv7-musleabihf - linux-x64-gnu - linux-x64-musl + - macos-aarch64 - macos-x64 - windows-x64-msvc rust: @@ -72,12 +77,29 @@ jobs: - build: android-aarch64 target: aarch64-linux-android cargo: cross + - build: linux-aarch64-gnu + target: aarch64-unknown-linux-gnu + cargo: cross + - build: linux-aarch64-musl + target: aarch64-unknown-linux-musl + cargo: cross + - build: linux-armv7-gnueabihf + target: armv7-unknown-linux-gnueabihf + cargo: cross + - build: linux-armv7-musleabihf + target: armv7-unknown-linux-musleabihf + cargo: cross - build: linux-x64-gnu target: x86_64-unknown-linux-gnu - build: linux-x64-musl target: x86_64-unknown-linux-musl + - build: macos-aarch64 + # Go back ot `macos-latest` after migration is complete + # See https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/. + os: macos-14 + target: aarch64-apple-darwin - build: macos-x64 - os: macos-latest + os: macos-14 target: x86_64-apple-darwin - build: windows-x64-msvc os: windows-latest @@ -95,7 +117,7 @@ jobs: - name: Install cross if: matrix.cargo == 'cross' - # The latest realese of `cross` is not able to build/link for `aarch64-linux-android` + # The latest release of `cross` is not able to build/link for `aarch64-linux-android` # See: https://github.com/cross-rs/cross/issues/1222 # This is fixed on `main` but not yet released. To avoid a breakage somewhen in the future # pin the cross revision used to the latest HEAD at 04/2024. diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 630cadd..7831491 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -52,25 +52,45 @@ jobs: strategy: matrix: build: - - aarch64-linux-android + - android-aarch64 + - linux-aarch64-gnu + - linux-aarch64-musl + - linux-armv7-gnueabihf + - linux-armv7-musleabihf - linux-x64-gnu - linux-x64-musl + - macos-aarch64 - macos-x64 - windows-x64-msvc include: + - os: ubuntu-latest # default - cargo: cargo # default; overwrite with `cross` if necessary - - build: aarch64-linux-android - os: ubuntu-latest + - build: android-aarch64 target: aarch64-linux-android cargo: cross + - build: linux-aarch64-gnu + target: aarch64-unknown-linux-gnu + cargo: cross + - build: linux-aarch64-musl + target: aarch64-unknown-linux-musl + cargo: cross + - build: linux-armv7-gnueabihf + target: armv7-unknown-linux-gnueabihf + cargo: cross + - build: linux-armv7-musleabihf + target: armv7-unknown-linux-musleabihf + cargo: cross - build: linux-x64-gnu - os: ubuntu-latest target: x86_64-unknown-linux-gnu - build: linux-x64-musl - os: ubuntu-latest target: x86_64-unknown-linux-musl + - build: macos-aarch64 + # Go back ot `macos-latest` after migration is complete + # See https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/. + os: macos-14 + target: aarch64-apple-darwin - build: macos-x64 - os: macos-latest + os: macos-14 target: x86_64-apple-darwin - build: windows-x64-msvc os: windows-latest @@ -86,13 +106,18 @@ jobs: toolchain: stable targets: ${{ matrix.target }} - - name: Install musl-tools - if: matrix.target == 'x86_64-unknown-linux-musl' - run: sudo apt-get install -y --no-install-recommends musl-tools - - name: Install cross if: matrix.cargo == 'cross' - run: cargo install --git https://github.com/cross-rs/cross.git --rev 085092c cross + # The latest release of `cross` is not able to build/link for `aarch64-linux-android` + # See: https://github.com/cross-rs/cross/issues/1222 + # This is fixed on `main` but not yet released. To avoid a breakage somewhen in the future + # pin the cross revision used to the latest HEAD at 04/2024. + # Go back to taiki-e/install-action once cross 0.3 is released. + uses: taiki-e/cache-cargo-install-action@v1 + with: + tool: cross + git: https://github.com/cross-rs/cross.git + rev: 085092c - name: Build release binary shell: bash diff --git a/CHANGELOG.md b/CHANGELOG.md index 64af0ca..ca6c8b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) * Add PID column to the process table #379 - @notjedi * CI: add builds for target `aarch64-linux-android` #384 - @flxo * CI: Keep GitHub Actions up to date with GitHub's Dependabot #403 - @cclauss +* CI: Enable more cross-compiled builds #401 - @cyqsimon ## Changed diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 0000000..07a5627 --- /dev/null +++ b/Cross.toml @@ -0,0 +1,2 @@ +[build.env] +passthrough = ["BANDWHICH_GEN_DIR"] |