Introduce src/gui and move the editing UI classes into it #11878
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 | |
| - release-** | |
| pull_request: | |
| release: | |
| types: ['published'] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: windows-2022 | |
| triplet: x64-windows-static | |
| arch: amd64 | |
| platform_arch: x64 | |
| - os: windows-11-arm | |
| triplet: arm64-windows-static | |
| arch: arm64 | |
| platform_arch: arm64 | |
| name: build (windows) | |
| runs-on: ${{ matrix.os }} | |
| outputs: | |
| artifact_name_arm64: ${{ steps.package.outputs.artifact_name_arm64 }} | |
| artifact_name_x64: ${{ steps.package.outputs.artifact_name_x64 }} | |
| steps: | |
| - name: ๐ฃ Checkout | |
| uses: actions/checkout@v7.0.0 | |
| with: | |
| submodules: recursive | |
| - name: Install NSIS | |
| uses: negrutiu/nsis-install@v3 | |
| with: | |
| version: 'v3.10.7422.0' | |
| - name: ๐งน Cleanup space | |
| shell: bash | |
| run: | | |
| echo "Free space before cleanup:" | |
| df -h /c | |
| # Remove Android SDKs/NDKs | |
| rm -rf /c/Android | |
| echo "Free space after cleanup:" | |
| df -h /c | |
| - name: ๐พ Prepare vars | |
| id: vars | |
| shell: bash | |
| run: | | |
| ./scripts/ci/env_gh.sh | |
| echo "BUILD_TYPE=Release" >> $GITHUB_ENV | |
| echo "CMAKE_BUILD_DIR=C:/builddir" >> $GITHUB_ENV | |
| - name: ๐งฝ Developer Command Prompt for Microsoft Visual C++ | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: ${{ matrix.arch }} | |
| # See https://github.com/actions/runner-images/issues/9398 | |
| # toolset: 14.39 | |
| - name: ๐จ Prepare build env | |
| shell: bash | |
| if: matrix.platform_arch == 'x64' | |
| run: | | |
| EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -D SENTRY_DSN=${{ secrets.SENTRY_DSN }}" | |
| echo "EXTRA_CMAKE_ARGS=${EXTRA_CMAKE_ARGS}" >> $GITHUB_ENV | |
| - name: ๐จ Uninstall system cmake | |
| if: matrix.os == 'windows-2022' | |
| shell: bash | |
| run: | | |
| choco uninstall cmake.install | |
| - name: ๐ฉ Install CMake and Ninja | |
| uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: 3.31.6 | |
| - name: ๐ฑ Install dependencies and generate project files | |
| shell: bash | |
| env: | |
| WORKSPACE: ${{ github.workspace }} | |
| run: | | |
| # Convert paths to bash compatible ones. Thanks to whoever decided to use drive letters and backslashes. | |
| CMAKE_BUILD_DIR=$( cygpath "${CMAKE_BUILD_DIR}" ) | |
| SOURCE_DIR=$( cygpath "${WORKSPACE}" ) | |
| source ./scripts/version_number.sh | |
| source ./scripts/ci/generate-version-details.sh | |
| cmake -S "${SOURCE_DIR}" \ | |
| -G Ninja \ | |
| -B "${CMAKE_BUILD_DIR}" \ | |
| -D CMAKE_C_COMPILER="C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/${{ matrix.platform_arch }}/bin/clang-cl.exe" \ | |
| -D CMAKE_CXX_COMPILER="C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/${{ matrix.platform_arch }}/bin/clang-cl.exe" \ | |
| -D CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ | |
| -D VCPKG_TARGET_TRIPLET="${{ matrix.triplet }}" \ | |
| -D VCPKG_HOST_TRIPLET="${{ matrix.triplet }}" \ | |
| -D WITH_VCPKG=ON \ | |
| -D WITH_SPIX=ON \ | |
| -D WITH_UNITTESTS=OFF \ | |
| -D WITH_NFC=OFF \ | |
| -D APP_VERSION="${APP_VERSION}" \ | |
| -D APP_VERSION_STR="${APP_VERSION_STR}" \ | |
| -D APP_PACKAGE_NAME="${APP_PACKAGE_NAME}" \ | |
| -D ENABLE_TESTS=ON \ | |
| -D NUGET_USERNAME=opengisch \ | |
| -D NUGET_TOKEN=${{ secrets.GITHUB_TOKEN }} \ | |
| -D CMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded\$<\$<CONFIG:Debug>:Debug>" \ | |
| -D PKG_CONFIG_EXECUTABLE=${CMAKE_BUILD_DIR}/vcpkg_installed/${{ matrix.triplet }}/tools/pkgconf/pkgconf.exe \ | |
| -D WITH_BLUETOOTH=ON \ | |
| -D VCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:/src;--x-abi-tools-use-exact-versions;--clean-after-build" \ | |
| -D CMAKE_COMPILE_WARNING_AS_ERROR=ON \ | |
| -D SENTRY_ENV="${APP_ENV}" \ | |
| -D CMAKE_WIN32_EXECUTABLE=ON \ | |
| -D PACKAGE_ZIP=ON \ | |
| ${EXTRA_CMAKE_ARGS} | |
| - name: ๐ Upload dep build logs | |
| uses: actions/upload-artifact@v7 | |
| if: failure() | |
| with: | |
| name: build-logs-${{ matrix.triplet }} | |
| path: | | |
| C:/src/**/*.log | |
| - name: Fix openh264 linking | |
| run: | | |
| sed -i 's/ openh264\.lib //g' /c/builddir/build.ninja | |
| - name: ๐ Build | |
| run: | | |
| cmake --build "${{ env.CMAKE_BUILD_DIR }}" --config ${{ env.BUILD_TYPE }} | |
| - name: ๐งซ Test | |
| shell: bash | |
| if: matrix.platform_arch == 'x64' | |
| env: | |
| PROJ_LIB: ${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed/${{ matrix.triplet }}/share/proj | |
| run: | | |
| SOURCE_DIR=$( cygpath "${{ github.workspace }}" ) | |
| pip install -r "${SOURCE_DIR}/test/spix/requirements.txt" | |
| cd "${{ env.CMAKE_BUILD_DIR }}" | |
| ctest --output-on-failure -C ${{ env.BUILD_TYPE }} -E qmltest | |
| - name: Install WiX | |
| run: | | |
| dotnet tool uninstall --global wix | |
| dotnet tool install --global wix --version 6.0.2 | |
| wix extension add --global WixToolset.UI.wixext/6.0.2 | |
| - name: Package | |
| id: package | |
| shell: bash | |
| run: | | |
| cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target bundle --config ${{ env.BUILD_TYPE }} --verbose -j1 | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| INSTALLER_SUFFIX="zip" | |
| else | |
| INSTALLER_SUFFIX="msi" | |
| fi | |
| ARTIFACT_PATHNAME=$(ls ${{ env.CMAKE_BUILD_DIR }}/QField-*-win64.${INSTALLER_SUFFIX} | head -n 1) | |
| mv "$ARTIFACT_PATHNAME" "${{ env.CMAKE_BUILD_DIR }}/QField-${{ matrix.platform_arch }}.${INSTALLER_SUFFIX}" | |
| ARTIFACT_PATHNAME="${{ env.CMAKE_BUILD_DIR }}/QField-${{ matrix.platform_arch }}.${INSTALLER_SUFFIX}" | |
| ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME) | |
| echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV | |
| echo "ARTIFACT_NAME=qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-windows-${{ matrix.platform_arch }}.${INSTALLER_SUFFIX}" >> $GITHUB_ENV | |
| echo "artifact_name_${{ matrix.platform_arch }}=${ARTIFACT_NAME}" >> "$GITHUB_OUTPUT" | |
| - name: ๐ Upload logs | |
| uses: actions/upload-artifact@v7 | |
| if: failure() | |
| with: | |
| name: package-logs-${{ matrix.triplet }} | |
| path: | | |
| ${{ env.CMAKE_BUILD_DIR }}/_CPack_Packages/**/*.log | |
| ${{ env.CMAKE_BUILD_DIR }}/_CPack_Packages/**/*.wxs | |
| ${{ env.CMAKE_BUILD_DIR }}/CMakeCache.txt | |
| - name: ๐ญ Sign | |
| if: ( github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') ) || github.event_name == 'workflow_dispatch' && env.ARTIFACT_NAME != null | |
| uses: azure/trusted-signing-action@v2.0.0 | |
| with: | |
| azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
| azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
| azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| endpoint: https://weu.codesigning.azure.net/ | |
| signing-account-name: OPENGISch | |
| certificate-profile-name: OPENGISch | |
| files-folder: ${{ env.CMAKE_BUILD_DIR }} | |
| files-folder-filter: exe,msi | |
| file-digest: SHA256 | |
| timestamp-rfc3161: http://timestamp.acs.microsoft.com | |
| timestamp-digest: SHA256 | |
| cache-dependencies: false | |
| - name: ๐ฆ Upload artifacts | |
| if: ${{ env.ARTIFACT_NAME != null }} | |
| uses: actions/upload-artifact@v7 | |
| id: artifact-windows | |
| with: | |
| name: ${{ env.ARTIFACT_NAME }} | |
| path: ${{ env.ARTIFACT_PATHNAME }} | |
| - name: ๐ Upload test report | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: "test-report-${{ matrix.triplet }}-${{ env.BUILD_TYPE }}" | |
| path: "${{ env.CMAKE_BUILD_DIR }}/report" | |
| - name: ๐ Upload release asset | |
| if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') && env.ARTIFACT_NAME != null | |
| uses: shogo82148/actions-upload-release-asset@v1.10.2 | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ${{ env.ARTIFACT_PATHNAME }} | |
| asset_name: ${{ env.ARTIFACT_NAME }} | |
| overwrite: true | |
| - name: ๐ Setup ruby | |
| uses: ruby/setup-ruby@v1.317.0 | |
| with: | |
| ruby-version: '3.4' # Not needed with a .ruby-version file | |
| bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
| - name: ๐บ Upload to S3 | |
| if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') | |
| env: | |
| S3_BUCKET: qfieldapks | |
| S3_REGION: ch-dk-2 | |
| S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY}} | |
| S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY}} | |
| run: | | |
| bundle exec fastlane windows upload_s3 exe:${{ env.ARTIFACT_PATHNAME }} | |
| - name: ๐ฎ Upload debug symbols | |
| if: ${{ env.SENTRY_AUTH_TOKEN != '' }} | |
| env: | |
| SENTRY_ORG_SLUG: opengisch | |
| SENTRY_PROJECT_SLUG: qfield | |
| run: | | |
| bundle exec fastlane run sentry_debug_files_upload path:${{ env.CMAKE_BUILD_DIR }}/output/bin/qfield.pdb | |
| comment_pr: | |
| name: comment (pr) | |
| runs-on: ubuntu-24.04 | |
| needs: build | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7.0.0 | |
| - name: Vars | |
| id: vars | |
| run: | | |
| ./scripts/ci/env_gh.sh | |
| - name: Schedule download comment | |
| uses: ./.github/actions/post_sticky_comment | |
| with: | |
| marker: windows | |
| body: | | |
| ### ๐ช Windows builds | |
| Download a [Windows build of this PR for testing](https://nightly.link/opengisch/QField/actions/runs/${{ github.run_id }}/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-windows-x64.zip) and for [arm64](https://nightly.link/opengisch/QField/actions/runs/${{ github.run_id }}/qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-windows-arm64.zip). | |
| *(Built from commit ${{ github.event.pull_request.head.sha }})* | |
| pr: ${{ github.event.number }} | |
| deploy: | |
| name: deploy (ms store) | |
| runs-on: windows-2022 | |
| if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') | |
| needs: build | |
| steps: | |
| - name: Configure Store Credentials | |
| uses: microsoft/store-submission@v1 | |
| with: | |
| command: configure | |
| type: win32 | |
| seller-id: ${{ secrets.MICROSOFT_STORE_SELLER_ID }} | |
| product-id: ${{ secrets.MICROSOFT_STORE_PRODUCT_ID }} | |
| tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
| client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
| client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| - name: Update Draft Submission | |
| uses: microsoft/store-submission@v1 | |
| with: | |
| command: update | |
| # See documentation here https://learn.microsoft.com/en-us/windows/apps/publish/store-submission-api#update-current-draft-submission-metadata-api | |
| product-update: '{"packages":[{"packageUrl":"https://sos-ch-dk-2.exo.io/qfieldapks/releases/files/${{ needs.build.outputs.artifact_name_x64 }}","languages":["en"],"architectures":["X64"],"isSilentInstall":false,"installerParameters":"/S","packageType":"exe","genericDocUrl":"https://nsis.sourceforge.io/Docs/AppendixD.html#errorlevels"}, {"packageUrl":"https://sos-ch-dk-2.exo.io/qfieldapks/releases/files/${{ needs.build.outputs.artifact_name_arm64 }}","languages":["en"],"architectures":["Arm64"],"isSilentInstall":false,"installerParameters":"/S","packageType":"exe","genericDocUrl":"https://nsis.sourceforge.io/Docs/AppendixD.html#errorlevels"}]}' | |
| - name: Publish Submission | |
| uses: microsoft/store-submission@v1 | |
| with: | |
| command: publish |