Skip to content

Commit

Permalink
Add aarch64 Linux build to releases
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Jan 17, 2025
1 parent 1cb0b68 commit 44ee2b3
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ jobs:
suffix: ubuntu-x86_64-${{ github.ref_name }}
modern-rustflags: "-C target-cpu=skylake"
rustflags: "-C target-cpu=x86-64-v2"
# TODO: Package for more Linux distributions/packaging formats/architectures and macOS
#- os: ubuntu-24.04
# target: aarch64-unknown-linux-gnu
# suffix: ubuntu-aarch64-${{ github.ref_name }}
# rustflags: "-C linker=aarch64-linux-gnu-gcc"
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
suffix: ubuntu-aarch64-${{ github.ref_name }}
rustflags: ""
- os: macos-14
target: aarch64-apple-darwin
suffix: macos-aarch64-${{ github.ref_name }}
Expand Down Expand Up @@ -137,10 +136,6 @@ jobs:
run: brew install automake
if: runner.os == 'macOS'

- name: AArch64 cross-compile packages
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends g++-aarch64-linux-gnu gcc-aarch64-linux-gnu libc6-dev-arm64-cross
if: matrix.build.target == 'aarch64-unknown-linux-gnu'

- name: Configure cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
Expand All @@ -154,7 +149,8 @@ jobs:
- name: Build app (Linux, modern, CUDA)
# CXX for CUDA
env:
CXX: g++-12
# TODO: Should have been g++-12, but it fails on aarch64: https://bugs.launchpad.net/ubuntu/+source/mumax3/+bug/2032624
CXX: g++-11
RUSTFLAGS: ${{ matrix.build.modern-rustflags }}
run: |
cargo -Zgitoxide -Zgit build --locked -Z build-std --target ${{ matrix.build.target }} --profile production --features cuda
Expand All @@ -178,7 +174,8 @@ jobs:
- name: Build app (Linux, normal, CUDA)
# CXX for CUDA
env:
CXX: g++-12
# TODO: Should have been g++-12, but it fails on aarch64: https://bugs.launchpad.net/ubuntu/+source/mumax3/+bug/2032624
CXX: g++-11
RUSTFLAGS: ${{ matrix.build.rustflags }}
run: cargo -Zgitoxide -Zgit build --locked -Z build-std --target ${{ matrix.build.target }} --profile production --features cuda
if: runner.os == 'Linux'
Expand Down Expand Up @@ -394,10 +391,10 @@ jobs:
mv target/${{ matrix.build.target }}/debian/*.deb .
# And build AppImage as well
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$(uname -p).AppImage
wget https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/3b67a1d1c1b0c8268f57f2bce40fe2d33d409cea/linuxdeploy-plugin-gtk.sh
chmod +x linuxdeploy*.AppImage linuxdeploy-plugin-gtk.sh
NO_STRIP=1 ./linuxdeploy-x86_64.AppImage \
NO_STRIP=1 ./linuxdeploy-$(uname -p).AppImage \
--appdir AppDir \
--plugin gtk \
--executable target/${{ matrix.build.target }}/production/space-acres \
Expand All @@ -408,7 +405,7 @@ jobs:
# Rename AppImage to be consistent with other files
version=$(grep -Po 'version = "\K.*?(?=")' -m 1 Cargo.toml)
mv Space_Acres-x86_64.AppImage space-acres-$version-x86_64.AppImage
mv Space_Acres-$(uname -p).AppImage space-acres-$version-$(uname -p).AppImage
if: runner.os == 'Linux' && matrix.build.modern-rustflags

- name: Package (Linux, without modern)
Expand All @@ -418,10 +415,10 @@ jobs:
mv target/${{ matrix.build.target }}/debian/*.deb .
# And build AppImage as well
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$(uname -p).AppImage
wget https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/3b67a1d1c1b0c8268f57f2bce40fe2d33d409cea/linuxdeploy-plugin-gtk.sh
chmod +x linuxdeploy*.AppImage linuxdeploy-plugin-gtk.sh
NO_STRIP=1 ./linuxdeploy-x86_64.AppImage \
NO_STRIP=1 ./linuxdeploy-$(uname -p).AppImage \
--appdir AppDir \
--plugin gtk \
--executable target/${{ matrix.build.target }}/production/space-acres \
Expand All @@ -431,7 +428,7 @@ jobs:
# Rename AppImage to be consistent with other files
version=$(grep -Po 'version = "\K.*?(?=")' -m 1 Cargo.toml)
mv Space_Acres-x86_64.AppImage space-acres-$version-x86_64.AppImage
mv Space_Acres-$(uname -p).AppImage space-acres-$version-$(uname -p).AppImage
if: runner.os == 'Linux' && !matrix.build.modern-rustflags

- name: Upload installer to artifacts (Linux)
Expand Down

0 comments on commit 44ee2b3

Please sign in to comment.