222 lines
6.1 KiB
YAML
222 lines
6.1 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "develop"
|
|
- "release-*"
|
|
paths:
|
|
# File types
|
|
- "**.cpp"
|
|
- "**.h"
|
|
- "**.java"
|
|
- "**.ui"
|
|
|
|
# Directories
|
|
- "buildconfig/**"
|
|
- "cmake/**"
|
|
- "launcher/**"
|
|
- "libraries/**"
|
|
- "program_info/**"
|
|
- "tests/**"
|
|
|
|
# Files
|
|
- "CMakeLists.txt"
|
|
- "COPYING.md"
|
|
|
|
# Workflows
|
|
- ".github/workflows/build.yml"
|
|
- ".github/actions/package/**"
|
|
- ".github/actions/setup-dependencies/**"
|
|
pull_request:
|
|
paths:
|
|
# File types
|
|
- "**.cpp"
|
|
- "**.h"
|
|
- "**.java"
|
|
- "**.ui"
|
|
|
|
# Directories
|
|
- "buildconfig/**"
|
|
- "cmake/**"
|
|
- "launcher/**"
|
|
- "libraries/**"
|
|
- "program_info/**"
|
|
- "tests/**"
|
|
|
|
# Files
|
|
- "CMakeLists.txt"
|
|
- "COPYING.md"
|
|
|
|
# Workflows
|
|
- ".github/workflows/build.yml"
|
|
- ".github/actions/package/**"
|
|
- ".github/actions/setup-dependencies/**"
|
|
workflow_call:
|
|
inputs:
|
|
build-type:
|
|
description: Type of build (Debug or Release)
|
|
type: string
|
|
default: Debug
|
|
workflow_dispatch:
|
|
inputs:
|
|
build-type:
|
|
description: Type of build (Debug or Release)
|
|
type: string
|
|
default: Debug
|
|
|
|
jobs:
|
|
build:
|
|
name: Build (${{ matrix.artifact-name }})
|
|
|
|
permissions:
|
|
# Required for Azure Trusted Signing
|
|
id-token: write
|
|
# Required for vcpkg binary cache
|
|
packages: write
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-22.04
|
|
artifact-name: Linux
|
|
cmake-preset: linux
|
|
|
|
# NOTE(@getchoo): Yes, we're intentionally using 24.04 here!!!
|
|
#
|
|
# It's not really documented anywhere AFAICT, but upstream Qt binaries
|
|
# *for the same version* are compiled against 24.04 on ARM, and *not* 22.04 like x64
|
|
- os: ubuntu-24.04-arm
|
|
artifact-name: Linux-aarch64
|
|
cmake-preset: linux
|
|
|
|
- os: windows-2022
|
|
artifact-name: Windows-MinGW-w64
|
|
cmake-preset: windows_mingw
|
|
msystem: CLANG64
|
|
vcvars-arch: amd64_x86
|
|
|
|
- os: windows-11-arm
|
|
artifact-name: Windows-MinGW-arm64
|
|
cmake-preset: windows_mingw
|
|
msystem: CLANGARM64
|
|
vcvars-arch: arm64
|
|
|
|
- os: windows-2022
|
|
artifact-name: Windows-MSVC
|
|
cmake-preset: windows_msvc
|
|
# TODO(@getchoo): This is the default in setup-dependencies/windows. Why isn't it working?!?!
|
|
vcvars-arch: amd64
|
|
|
|
- os: windows-11-arm
|
|
artifact-name: Windows-MSVC-arm64
|
|
cmake-preset: windows_msvc
|
|
vcvars-arch: arm64
|
|
|
|
- os: macos-14
|
|
artifact-name: macOS
|
|
cmake-preset: macos_universal
|
|
macosx-deployment-target: 12.0
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
defaults:
|
|
run:
|
|
shell: ${{ matrix.msystem != '' && 'msys2 {0}' || 'bash' }}
|
|
|
|
env:
|
|
ARTIFACT_NAME: ${{ matrix.artifact-name }}-Qt6
|
|
BUILD_PLATFORM: official
|
|
BUILD_TYPE: ${{ inputs.build-type || 'Debug' }}
|
|
CMAKE_PRESET: ${{ matrix.cmake-preset }}
|
|
|
|
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx-deployment-target }}
|
|
|
|
steps:
|
|
##
|
|
# SETUP
|
|
##
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Setup dependencies
|
|
id: setup-dependencies
|
|
uses: ./.github/actions/setup-dependencies
|
|
with:
|
|
build-type: ${{ env.BUILD_TYPE }}
|
|
artifact-name: ${{ matrix.artifact-name }}
|
|
msystem: ${{ matrix.msystem }}
|
|
vcvars-arch: ${{ matrix.vcvars-arch }}
|
|
qt-architecture: ${{ matrix.qt-architecture }}
|
|
|
|
##
|
|
# BUILD
|
|
##
|
|
|
|
- name: Configure project
|
|
run: |
|
|
cmake --preset "$CMAKE_PRESET"
|
|
|
|
- name: Run build
|
|
run: |
|
|
cmake --build --preset "$CMAKE_PRESET" --config "$BUILD_TYPE"
|
|
|
|
- name: Run tests
|
|
run: |
|
|
ctest --preset "$CMAKE_PRESET" --build-config "$BUILD_TYPE"
|
|
|
|
##
|
|
# PACKAGE
|
|
##
|
|
|
|
- name: Get short version
|
|
id: short-version
|
|
shell: bash
|
|
run: |
|
|
echo "version=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Package (Linux)
|
|
if: ${{ runner.os == 'Linux' }}
|
|
uses: ./.github/actions/package/linux
|
|
with:
|
|
version: ${{ steps.short-version.outputs.version }}
|
|
build-type: ${{ steps.setup-dependencies.outputs.build-type }}
|
|
artifact-name: ${{ matrix.artifact-name }}
|
|
qt-version: ${{ steps.setup-dependencies.outputs.qt-version }}
|
|
|
|
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
|
|
gpg-private-key-id: ${{ secrets.GPG_PRIVATE_KEY_ID }}
|
|
|
|
- name: Package (macOS)
|
|
if: ${{ runner.os == 'macOS' }}
|
|
uses: ./.github/actions/package/macos
|
|
with:
|
|
version: ${{ steps.short-version.outputs.version }}
|
|
build-type: ${{ steps.setup-dependencies.outputs.build-type }}
|
|
artifact-name: ${{ matrix.artifact-name }}
|
|
|
|
apple-codesign-cert: ${{ secrets.APPLE_CODESIGN_CERT }}
|
|
apple-codesign-password: ${{ secrets.APPLE_CODESIGN_PASSWORD }}
|
|
apple-codesign-id: ${{ secrets.APPLE_CODESIGN_ID }}
|
|
apple-notarize-apple-id: ${{ secrets.APPLE_NOTARIZE_APPLE_ID }}
|
|
apple-notarize-team-id: ${{ secrets.APPLE_NOTARIZE_TEAM_ID }}
|
|
apple-notarize-password: ${{ secrets.APPLE_NOTARIZE_PASSWORD }}
|
|
sparkle-ed25519-key: ${{ secrets.SPARKLE_ED25519_KEY }}
|
|
|
|
- name: Package (Windows)
|
|
if: ${{ runner.os == 'Windows' }}
|
|
uses: ./.github/actions/package/windows
|
|
with:
|
|
version: ${{ steps.short-version.outputs.version }}
|
|
build-type: ${{ steps.setup-dependencies.outputs.build-type }}
|
|
artifact-name: ${{ matrix.artifact-name }}
|
|
msystem: ${{ matrix.msystem }}
|
|
|
|
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
|
|
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
|
azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|