Switch to C++20 #1431
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linux AArch64 (aarch64-linux-gnu) | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '*.md' | |
pull_request: | |
types: [opened, synchronize] | |
paths-ignore: | |
- '*.md' | |
release: | |
types: [published] | |
paths-ignore: | |
- '*.md' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Create Build Environment | |
run: | | |
# Work around the somewhat broken packages in the GitHub Actions Ubuntu 20.04 image. | |
# https://github.com/actions/runner-images/issues/4620#issuecomment-981333260 | |
sudo apt-get -y install --allow-downgrades libpcre2-8-0=10.34-7 | |
Packaging/nix/debian-cross-aarch64-prep.sh --no-gcc | |
# Install clang-18: | |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc | |
sudo tee /etc/apt/sources.list.d/clang.list <<LIST | |
deb [arch=amd64,arm64] http://apt.llvm.org/focal/ llvm-toolchain-focal main | |
deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal main | |
LIST | |
sudo apt-get update | |
sudo apt-get install -yq --no-install-recommends clang-18 libc++-18-dev:arm64 | |
sudo update-alternatives --install \ | |
/usr/bin/clang clang /usr/bin/clang-18 \ | |
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-18 \ | |
--slave /usr/bin/lld lld /usr/bin/lld-18 \ | |
--slave /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-18 | |
- name: Cache CMake build folder | |
uses: actions/cache@v3 | |
with: | |
path: build | |
key: ${{ github.workflow }}-v5-${{ github.sha }} | |
restore-keys: ${{ github.workflow }}-v5- | |
- name: Build | |
working-directory: ${{github.workspace}} | |
shell: bash | |
env: | |
CMAKE_BUILD_TYPE: ${{github.event_name == 'release' && 'Release' || 'RelWithDebInfo'}} | |
# We set DEVILUTIONX_SYSTEM_LIBFMT=OFF because its soversion changes frequently. | |
# We set DEVILUTIONX_SYSTEM_SIMPLEINI=OFF because we require v4.19+, still missing from many distributions. | |
run: | | |
cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/aarch64-linux-gnu-clang-static-libc++.toolchain.cmake \ | |
-DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr -DCPACK=ON \ | |
-DDEVILUTIONX_SYSTEM_LIBFMT=OFF -DDEVILUTIONX_SYSTEM_SIMPLEINI=OFF && \ | |
cmake --build build -j $(getconf _NPROCESSORS_ONLN) --target package | |
- name: Package | |
run: Packaging/nix/LinuxReleasePackaging.sh && mv devilutionx.tar.xz devilutionx-aarch64-linux-gnu.tar.xz | |
# AppImage cross-packaging is not implemented yet. | |
# - name: Package AppImage | |
# run: Packaging/nix/AppImage.sh && mv devilutionx.appimage devilutionx-aarch64-linux-gnu.appimage | |
- name: Upload Package | |
if: ${{ !env.ACT }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: devilutionx-aarch64-linux-gnu.tar.xz | |
path: devilutionx-aarch64-linux-gnu.tar.xz | |
# AppImage cross-packaging is not implemented yet. | |
# - name: Upload AppImage | |
# if: ${{ !env.ACT }} | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: devilutionx-aarch64-linux-gnu.appimage | |
# path: devilutionx-aarch64-linux-gnu.appimage | |
- name: Update Release | |
if: ${{ github.event_name == 'release' && !env.ACT }} | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: devilutionx-aarch64-linux-gnu.* | |
file_glob: true | |
overwrite: true | |
- name: Clean up artifacts | |
run: rm -rf build/_CPack_Packages build/package build/*.deb build/*.rpm build/*.appimage build/*.tar.xz |