Skip to content

Fix lupdate JSON path and add weekly schedule #16

Fix lupdate JSON path and add weekly schedule

Fix lupdate JSON path and add weekly schedule #16

Workflow file for this run

name: Windows
on:
push:
branches:
- master
- 'Stable*'
tags:
- 'v*'
paths-ignore:
- 'docs/**'
pull_request:
merge_group:
workflow_dispatch:
inputs:
build_type:
description: 'Build type'
required: false
default: 'Release'
type: choice
options:
- Release
- Debug
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
permissions:
contents: read
id-token: write
attestations: write
actions: read
security-events: write
jobs:
changes:
uses: ./.github/workflows/_detect-changes.yml
with:
platform: windows
build:
name: Build ${{ matrix.arch }} ${{ matrix.build_type }}
needs: changes
if: always() && !cancelled() && (needs.changes.outputs.should_build == 'true' || needs.changes.result == 'skipped')
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
build_type: ${{ inputs.build_type && fromJSON(format('["{0}"]', inputs.build_type)) || fromJSON('["Release"]') }}
variant: [amd64, arm64, arm64-cross]
include:
- variant: amd64
os: windows-2022
host: windows
arch: win64_msvc2022_64
package: QGroundControl-installer-AMD64
- variant: arm64
os: windows-11-arm
host: windows_arm64
arch: win64_msvc2022_arm64
package: QGroundControl-installer-ARM64
# TODO: Remove qt_version override once aqtinstall supports Qt 6.10.1+ for cross-compiled ARM64
# Workaround: Pin to Qt 6.10.0 until aqtinstall fix is released
# Tracking: https://github.com/miurahr/aqtinstall/pull/952
- variant: arm64-cross
os: windows-2022
host: windows
arch: win64_msvc2022_arm64_cross_compiled
package: QGroundControl-installer-AMD64-ARM64
qt_version: '6.10.0'
defaults:
run:
shell: cmd
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Checkout repo
uses: actions/checkout@v6
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 1 || 0 }}
fetch-tags: ${{ github.event_name != 'pull_request' }}
- name: Build Setup
id: build-setup
uses: ./.github/actions/build-setup
with:
qt-host: ${{ matrix.host }}
qt-arch: ${{ matrix.arch }}
qt-version: ${{ matrix.qt_version || '' }}
build-type: ${{ matrix.build_type }}
- name: Install GStreamer
if: matrix.arch == 'win64_msvc2022_64'
uses: ./.github/actions/install-dependencies
with:
gstreamer-version: ${{ steps.build-setup.outputs.gstreamer_windows_version }}
- name: Set up MSVC environment
uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: ${{ (matrix.arch == 'win64_msvc2022_64' && 'x64') || (matrix.arch == 'win64_msvc2022_arm64' && 'arm64') || 'amd64_arm64' }}
- name: Install host Qt for ARM64 cross-compilation
if: matrix.arch == 'win64_msvc2022_arm64_cross_compiled'
id: qt-host
uses: ./.github/actions/qt-install
with:
version: ${{ steps.build-setup.outputs.qt_version }}
host: windows
arch: win64_msvc2022_64
modules: ${{ steps.build-setup.outputs.qt_modules }}
export-env: 'false'
- name: Fix Rust linker resolution (ARM64 native)
if: matrix.variant == 'arm64'
shell: bash
run: |
# Git for Windows ships /usr/bin/link (GNU coreutils) which shadows
# MSVC's link.exe on PATH, causing Rust/cargo builds to fail.
# Rename the conflicting binary so MSVC's linker is found instead.
git_link="/c/Program Files/Git/usr/bin/link.exe"
if [ -f "$git_link" ]; then
mv "$git_link" "${git_link}.bak"
echo "Renamed Git link.exe to prevent Rust linker conflict"
fi
- name: Configure
uses: ./.github/actions/cmake-configure
with:
build-dir: ${{ runner.temp }}/build
build-type: ${{ matrix.build_type }}
stable: ${{ (github.ref_type == 'tag' || contains(github.ref, 'Stable')) && 'true' || 'false' }}
extra-args: >-
-DQGC_ENABLE_GST_VIDEOSTREAMING=${{ matrix.arch == 'win64_msvc2022_64' && 'ON' || 'OFF' }}
${{ matrix.arch == 'win64_msvc2022_arm64_cross_compiled' && format('-DQT_HOST_PATH={0}', steps.qt-host.outputs.qt_root_dir) || '' }}
- name: Build
uses: ./.github/actions/cmake-build
with:
build-dir: ${{ runner.temp }}/build
build-type: ${{ matrix.build_type }}
- name: Verify Executable
if: matrix.build_type == 'Release' && matrix.arch != 'win64_msvc2022_arm64_cross_compiled'
uses: ./.github/actions/verify-executable
with:
binary-path: ${{ runner.temp }}/build/${{ matrix.build_type }}/QGroundControl.exe
type: exe
- name: Create Installer
working-directory: ${{ runner.temp }}\build
run: cmake --install . --config ${{ matrix.build_type }}
- name: Attest and Upload
if: matrix.build_type == 'Release'
uses: ./.github/actions/attest-and-upload
with:
artifact-name: ${{ matrix.package }}.exe
package-name: ${{ matrix.package }}
aws-role-arn: ${{ secrets.AWS_ROLE_ARN }}
aws-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-distribution-id: ${{ secrets.AWS_DISTRIBUTION_ID }}
upload-aws: ${{ matrix.arch == 'win64_msvc2022_arm64_cross_compiled' && 'false' || 'true' }}