Reorganization of resources. #6
This file contains hidden or 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: Windows | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - 'Stable*' | |
| tags: | |
| - 'v*' | |
| paths-ignore: | |
| - 'docs/**' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/windows.yml' | |
| - '.github/actions/**' | |
| - 'deploy/windows/**' | |
| - 'src/**' | |
| - 'test/**' | |
| - 'custom-example/**' | |
| - 'CMakeLists.txt' | |
| - 'cmake/**' | |
| - 'tools/setup/*windows*' | |
| workflow_dispatch: | |
| inputs: | |
| build_type: | |
| description: 'Build type' | |
| required: false | |
| default: 'Release' | |
| type: choice | |
| options: | |
| - Release | |
| - Debug | |
| workflow_call: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
| permissions: | |
| contents: read | |
| id-token: write | |
| attestations: write | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.custom_build && 'Custom' || matrix.arch }} ${{ matrix.build_type }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 120 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: windows-2022 | |
| host: windows | |
| arch: win64_msvc2022_64 | |
| build_type: Release | |
| package: QGroundControl-installer-AMD64 | |
| - os: windows-11-arm | |
| host: windows_arm64 | |
| arch: win64_msvc2022_arm64 | |
| build_type: Release | |
| 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 | |
| - os: windows-2022 | |
| host: windows | |
| arch: win64_msvc2022_arm64_cross_compiled | |
| build_type: Release | |
| package: QGroundControl-installer-AMD64-ARM64 | |
| qt_version: '6.10.0' | |
| - os: windows-2022 | |
| host: windows | |
| arch: win64_msvc2022_64 | |
| build_type: Release | |
| custom_build: true | |
| package: Custom-QGroundControl | |
| defaults: | |
| run: | |
| shell: cmd | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 1 | |
| fetch-tags: true | |
| - name: Enable custom build | |
| if: matrix.custom_build | |
| uses: ./.github/actions/custom-build | |
| - name: Get build config | |
| id: config | |
| uses: ./.github/actions/build-config | |
| - name: Common setup | |
| uses: ./.github/actions/common | |
| - name: Install GStreamer | |
| if: matrix.arch == 'win64_msvc2022_64' | |
| shell: pwsh | |
| run: | | |
| ./tools/setup/install-dependencies-windows.ps1 ` | |
| -GStreamerVersion ${{ steps.config.outputs.gstreamer_windows_version }} ` | |
| -SkipVulkan | |
| - name: Setup cache | |
| uses: ./.github/actions/cache | |
| with: | |
| host: ${{ matrix.host }} | |
| target: ${{ matrix.arch }} | |
| build-type: ${{ matrix.build_type }} | |
| cpm-modules: ${{ runner.temp }}\build\cpm_modules | |
| save-cache: ${{ github.event_name != 'pull_request' }} | |
| - name: Install Qt ${{ matrix.qt_version || steps.config.outputs.qt_version }} | |
| uses: ./.github/actions/qt-install | |
| with: | |
| version: ${{ matrix.qt_version || steps.config.outputs.qt_version }} | |
| host: ${{ matrix.host }} | |
| arch: ${{ matrix.arch }} | |
| modules: ${{ steps.config.outputs.qt_modules }} | |
| - 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: Configure | |
| working-directory: ${{ runner.temp }}\build | |
| run: | | |
| ${{ env.QT_ROOT_DIR }}\bin\qt-cmake -S ${{ github.workspace }} -B . -G Ninja ^ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ^ | |
| -DQGC_STABLE_BUILD=${{ (github.ref_type == 'tag' || contains(github.ref, 'Stable')) && 'ON' || 'OFF' }} ^ | |
| -DQGC_ENABLE_GST_VIDEOSTREAMING=${{ matrix.arch == 'win64_msvc2022_64' && 'ON' || 'OFF' }} ^ | |
| -DQT_HOST_PATH=${{ (matrix.arch == 'win64_msvc2022_arm64_cross_compiled') && format('{0}\\..\\msvc2022_64', env.QT_ROOT_DIR) || '' }} | |
| - name: Build | |
| working-directory: ${{ runner.temp }}\build | |
| run: cmake --build . --target all --config ${{ matrix.build_type }} --parallel | |
| - name: Verify Executable | |
| if: matrix.build_type == 'Release' && matrix.arch != 'win64_msvc2022_arm64_cross_compiled' && !matrix.custom_build | |
| working-directory: ${{ runner.temp }}\build\${{ matrix.build_type }} | |
| run: QGroundControl.exe --simple-boot-test | |
| - name: Verify Custom Executable | |
| if: matrix.custom_build | |
| working-directory: ${{ runner.temp }}\build\${{ matrix.build_type }} | |
| run: Custom-QGroundControl.exe --simple-boot-test | |
| - name: Create Installer | |
| working-directory: ${{ runner.temp }}\build | |
| run: cmake --install . --config ${{ matrix.build_type }} | |
| - name: Attest Build Provenance | |
| if: matrix.build_type == 'Release' && !matrix.custom_build && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) | |
| uses: actions/attest-build-provenance@v3 | |
| with: | |
| subject-path: '${{ runner.temp }}\build\${{ matrix.package }}.exe' | |
| - name: Upload artifact (installer) | |
| if: matrix.build_type == 'Release' && !matrix.custom_build | |
| uses: ./.github/actions/upload | |
| with: | |
| artifact_name: ${{ matrix.package }}.exe | |
| package_name: ${{ matrix.package }} | |
| 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' }} |