Skip to content

ci: retry docs deploy push with rebase on concurrent-deploy rejection #18

ci: retry docs deploy push with rebase on concurrent-deploy rejection

ci: retry docs deploy push with rebase on concurrent-deploy rejection #18

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
actions: read
env:
AQT_SOURCE: 'git+https://github.com/miurahr/aqtinstall.git@8d961e61720b3c06583517fbc68d57ec0a4e9f95'
jobs:
changes:
uses: ./.github/workflows/_detect-changes.yml
with:
platform: windows
build:
name: Build ${{ matrix.arch }} ${{ matrix.build_type }}
needs: changes
if: needs.changes.outputs.should_build == 'true'
runs-on: ${{ matrix.runs_on }}
timeout-minutes: 120
# id-token/attestations scoped here: only the attestation upload step needs them.
permissions:
contents: read
actions: read
id-token: write
attestations: write
strategy:
fail-fast: false
matrix:
build_type: ['${{ inputs.build_type || ''Release'' }}']
variant: [amd64, arm64, arm64-cross]
include:
- variant: amd64
runs_on: ${{ github.repository_owner == 'mavlink' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && format('runs-on={0}/runner=windows-x64-builder', github.run_id) || 'windows-2022' }}
host: windows
arch: win64_msvc2022_64
package: QGroundControl-installer-AMD64
gstreamer: true
- variant: arm64
runs_on: windows-11-arm
host: windows_arm64
arch: win64_msvc2022_arm64
package: QGroundControl-installer-ARM64
gstreamer: true
- variant: arm64-cross
runs_on: ${{ github.repository_owner == 'mavlink' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && format('runs-on={0}/runner=windows-x64-builder', github.run_id) || 'windows-2022' }}
host: windows
arch: win64_msvc2022_arm64_cross_compiled
package: QGroundControl-installer-AMD64-ARM64
gstreamer: false
defaults:
run:
shell: cmd
steps:
- name: Enable RunsOn magic cache
if: github.repository_owner == 'mavlink' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && matrix.variant != 'arm64'
uses: runs-on/action@v2
with:
metrics: cpu,network,memory,disk,io
show_costs: summary
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Checkout repo
uses: actions/checkout@v7
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 1 || 0 }}
persist-credentials: false
- name: Install Visual Studio Build Tools
if: github.repository_owner == 'mavlink' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && matrix.variant != 'arm64'
uses: ./.github/actions/install-dependencies
with:
gstreamer: 'false'
msvc: 'true'
msvc-arm64: ${{ matrix.variant == 'arm64-cross' }}
nsis: 'true'
- name: Build Setup
id: build-setup
uses: ./.github/actions/build-setup
with:
qt-host: ${{ matrix.host }}
qt-arch: ${{ matrix.arch }}
aqt-source: ${{ env.AQT_SOURCE }}
build-type: ${{ matrix.build_type }}
- name: Configure
uses: ./.github/actions/cmake-configure
with:
build-dir: ${{ runner.temp }}/build
build-type: ${{ matrix.build_type }}
extra-args: >-
-DQGC_ENABLE_GST_VIDEOSTREAMING=${{ matrix.gstreamer && 'ON' || 'OFF' }}
${{ matrix.arch == 'win64_msvc2022_arm64_cross_compiled' && format('-DQT_HOST_PATH={0}', steps.build-setup.outputs.host_qt_root_dir) || '' }}
- name: Resolve GStreamer root
id: gst-root
if: matrix.gstreamer
shell: bash
run: |
python3 "${GITHUB_WORKSPACE}/.github/scripts/cmake_helper.py" cache-var \
--build-dir "${RUNNER_TEMP}/build" \
--name GStreamer_ROOT_DIR \
--required \
--output-key gst_root
- name: Add GStreamer to PATH
if: matrix.gstreamer
shell: bash
run: echo "${STEPS_GST_ROOT_OUTPUTS_GST_ROOT}/bin" >> "$GITHUB_PATH"
env:
STEPS_GST_ROOT_OUTPUTS_GST_ROOT: ${{ steps.gst-root.outputs.gst_root }}
- 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
build-dir: ${{ runner.temp }}/build
- name: Create Installer
uses: ./.github/actions/cmake-install
with:
build-dir: ${{ runner.temp }}\build
build-type: ${{ matrix.build_type }}
- name: Install and verify installer
if: matrix.build_type == 'Release' && matrix.arch != 'win64_msvc2022_arm64_cross_compiled'
shell: pwsh
run: |
$buildDir = "${{ runner.temp }}\build"
$installerExe = Get-ChildItem -Path $buildDir -Filter "*installer*.exe" | Select-Object -First 1
if (-not $installerExe) {
Write-Error "Installer .exe not found in $buildDir"
exit 1
}
$installDir = "${{ runner.temp }}\qgc-install-test"
Write-Host "Installing $($installerExe.Name) to $installDir"
Start-Process -FilePath $installerExe.FullName -ArgumentList "/S", "/D=$installDir" -Wait -NoNewWindow
$binary = Join-Path $installDir "bin\QGroundControl.exe"
if (-not (Test-Path $binary)) {
Write-Error "QGroundControl.exe not found at $binary after install"
Get-ChildItem -Path $installDir -Recurse | Select-Object FullName
exit 1
}
$expectGstreamer = "${{ matrix.gstreamer }}" -eq "true"
$pluginDir = Join-Path $installDir "lib\gstreamer-1.0"
if (-not $expectGstreamer) {
Write-Host "GStreamer disabled for this build; skipping plugin verification"
} elseif (Test-Path $pluginDir) {
$pluginCount = (Get-ChildItem -Path $pluginDir -Filter "*.dll" | Measure-Object).Count
Write-Host "GStreamer plugins found: $pluginCount"
if ($pluginCount -eq 0) {
Write-Error "No GStreamer plugin DLLs found in $pluginDir"
exit 1
}
} else {
Write-Error "GStreamer plugin directory not found: $pluginDir"
exit 1
}
- name: Remove build SDK from PATH for installed verification
if: matrix.build_type == 'Release' && matrix.gstreamer
shell: pwsh
env:
GST_ROOT: ${{ steps.gst-root.outputs.gst_root }}
run: |
$sdkBin = Join-Path $env:GST_ROOT "bin"
$sanitizedPath = (($env:PATH -split ';') | Where-Object { $_ -and ($_ -ne $sdkBin) }) -join ';'
"QGC_VERIFY_INSTALLED_PATH=$sanitizedPath" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Verify installed executable
if: matrix.build_type == 'Release' && matrix.arch != 'win64_msvc2022_arm64_cross_compiled'
uses: ./.github/actions/verify-executable
env:
PATH: ${{ env.QGC_VERIFY_INSTALLED_PATH || env.PATH }}
with:
binary-path: ${{ runner.temp }}\qgc-install-test\bin\QGroundControl.exe
type: exe
- 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' }}