mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-23 14:41:33 -04:00
157f4f9df2
* Rebrand * Revert Info.plist.in * Think, Mark!
275 lines
7.8 KiB
YAML
275 lines
7.8 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- '*.md'
|
|
- '*LICENSE'
|
|
pull_request:
|
|
|
|
env:
|
|
SCCACHE_GHA_ENABLED: "true"
|
|
RUSTC_WRAPPER: "sccache"
|
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
|
|
|
jobs:
|
|
build-linux:
|
|
name: Build Linux (${{matrix.name}})
|
|
runs-on: ${{matrix.runner}}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: GCC x86_64
|
|
runner: ubuntu-latest
|
|
preset: gcc
|
|
artifact_arch: x86_64
|
|
# - name: GCC aarch64
|
|
# runner: ubuntu-24.04-arm
|
|
# preset: gcc
|
|
# artifact_arch: aarch64
|
|
# - name: Clang x86_64
|
|
# runner: ubuntu-latest
|
|
# preset: clang
|
|
# artifact_arch: x86_64
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get -y install ninja-build clang lld openssl libcurl4-openssl-dev \
|
|
zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \
|
|
libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev libfreetype-dev \
|
|
libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev libssl-dev \
|
|
libxss-dev libfuse2 libusb-1.0-0-dev libdecor-0-dev libpipewire-0.3-dev libunwind-dev
|
|
|
|
- name: Setup sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.10
|
|
|
|
- name: Print sccache stats
|
|
run: sccache --show-stats
|
|
|
|
- name: Configure CMake
|
|
run: cmake --preset x-linux-ci-${{matrix.preset}}
|
|
|
|
- name: Build
|
|
run: cmake --build --preset x-linux-ci-${{matrix.preset}}
|
|
|
|
- name: Generate AppImage
|
|
run: ci/build-appimage.sh
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: dusklight-${{env.DUSK_VERSION}}-linux-${{matrix.preset}}-${{matrix.artifact_arch}}
|
|
path: |
|
|
build/install/Dusklight-*.AppImage
|
|
build/install/debug.tar.*
|
|
|
|
build-apple:
|
|
name: Build Apple (${{matrix.name}})
|
|
runs-on: macos-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: AppleClang macOS arm64
|
|
platform: macos
|
|
preset: x-macos-ci-arm64
|
|
artifact_name: macos-appleclang-arm64
|
|
- name: AppleClang macOS x86_64
|
|
platform: macos
|
|
preset: x-macos-ci-x86_64
|
|
artifact_name: macos-appleclang-x86_64
|
|
- name: AppleClang iOS arm64
|
|
platform: ios
|
|
preset: x-ios-ci
|
|
artifact_name: ios-appleclang-arm64
|
|
# - name: AppleClang tvOS arm64
|
|
# platform: tvos
|
|
# preset: x-tvos-ci
|
|
# artifact_name: tvos-appleclang-arm64
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: Install dependencies
|
|
run: brew install cmake ninja
|
|
|
|
- name: Install Rust iOS target
|
|
if: matrix.platform == 'ios'
|
|
run: |
|
|
rustup toolchain install stable
|
|
rustup target add aarch64-apple-ios
|
|
|
|
- name: Install Rust tvOS target
|
|
if: matrix.platform == 'tvos'
|
|
run: |
|
|
rustup toolchain install nightly
|
|
rustup target add --toolchain nightly aarch64-apple-tvos
|
|
|
|
- name: Install Rust x86_64 macOS target
|
|
if: endsWith(matrix.preset, 'x86_64')
|
|
run: |
|
|
rustup toolchain install stable
|
|
rustup target add x86_64-apple-darwin
|
|
|
|
- name: Setup sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.10
|
|
|
|
- name: Configure CMake
|
|
run: cmake --preset ${{matrix.preset}}
|
|
|
|
- name: Build
|
|
run: cmake --build --preset ${{matrix.preset}}
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: dusklight-${{env.DUSK_VERSION}}-${{matrix.artifact_name}}
|
|
path: |
|
|
build/install/Dusklight.app
|
|
build/install/debug.tar.*
|
|
|
|
build-android:
|
|
name: Build Android (${{matrix.name}})
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: Clang arm64-v8a
|
|
preset: x-android-ci-arm64
|
|
abi: arm64-v8a
|
|
artifact_arch: arm64
|
|
rust_target: aarch64-linux-android
|
|
|
|
env:
|
|
ANDROID_NDK_VERSION: "29.0.14206865"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get -y install ninja-build
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: temurin
|
|
java-version: 17
|
|
|
|
- name: Setup Android SDK
|
|
uses: android-actions/setup-android@v4
|
|
|
|
- name: Install Android SDK packages
|
|
run: sdkmanager "platforms;android-36" "build-tools;36.1.0" "ndk;${ANDROID_NDK_VERSION}"
|
|
|
|
- name: Install Rust Android target
|
|
run: |
|
|
rustup toolchain install stable
|
|
rustup target add ${{matrix.rust_target}}
|
|
|
|
- name: Setup sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.10
|
|
|
|
- name: Configure CMake
|
|
run: cmake --preset ${{matrix.preset}}
|
|
|
|
- name: Build native library
|
|
run: cmake --build --preset ${{matrix.preset}} --target dusklight
|
|
|
|
- name: Stage stripped JNI library
|
|
run: ANDROID_STAGE_ABIS="${{matrix.abi}}" platforms/android/scripts/stage-jni-libs.sh
|
|
|
|
- name: Build APK
|
|
working-directory: platforms/android
|
|
run: ./gradlew :app:assembleRelease --rerun-tasks
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: dusklight-${{env.DUSK_VERSION}}-android-${{matrix.artifact_arch}}
|
|
path: platforms/android/app/build/outputs/apk/release/app-${{matrix.abi}}-release-unsigned.apk
|
|
|
|
build-windows:
|
|
name: Build Windows (${{matrix.name}})
|
|
runs-on: ${{matrix.runner}}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: MSVC x86_64
|
|
runner: windows-latest
|
|
preset: msvc
|
|
msvc_arch: amd64
|
|
vcpkg_arch: x64
|
|
artifact_arch: x86_64
|
|
# - name: MSVC arm64
|
|
# runner: windows-11-arm
|
|
# preset: arm64-msvc
|
|
# msvc_arch: arm64
|
|
# vcpkg_arch: arm64
|
|
# artifact_arch: arm64
|
|
# - name: Clang x86_64
|
|
# runner: windows-latest
|
|
# preset: clang
|
|
# msvc_arch: amd64
|
|
# vcpkg_arch: x64
|
|
# artifact_arch: x86_64
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: Enable Visual Studio environment
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
with:
|
|
arch: ${{matrix.msvc_arch}}
|
|
|
|
# msvc-dev-cmd sets VCPKG_ROOT, set it back
|
|
- name: Override VCPKG_ROOT
|
|
run: echo "VCPKG_ROOT=C:\vcpkg" >> $env:GITHUB_ENV
|
|
|
|
- name: Setup sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.9
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
choco install ninja
|
|
vcpkg install freetype:${{matrix.vcpkg_arch}}-windows-static zstd:${{matrix.vcpkg_arch}}-windows-static
|
|
|
|
- name: Configure CMake
|
|
run: cmake --preset x-windows-ci-${{matrix.preset}}
|
|
|
|
- name: Build
|
|
run: cmake --build --preset x-windows-ci-${{matrix.preset}}
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: dusklight-${{env.DUSK_VERSION}}-win32-msvc-${{matrix.artifact_arch}}
|
|
path: |
|
|
build/install/*.exe
|
|
build/install/*.dll
|
|
build/install/res/
|
|
build/install/debug.7z
|