[Backport release-4_1] Truly fix the legend image fetcher crash #9444
Workflow file for this run
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: ๐ MacOS | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - release-** | |
| pull_request: | |
| release: | |
| types: ['published'] | |
| 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: macos-15 | |
| triplet: x64-osx | |
| deployment-target: "10.15" | |
| target-arch: x86_64 | |
| run-tests: false | |
| - os: macos-15 | |
| triplet: arm64-osx | |
| deployment-target: "11.0" | |
| target-arch: arm64 | |
| run-tests: true | |
| name: build (macos) | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: ๐ฃ Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: ๐พ Prepare variables | |
| id: vars | |
| run: | | |
| ./scripts/ci/env_gh.sh | |
| BUILD_ROOT="/Users/runner" | |
| echo "BUILD_ROOT=${BUILD_ROOT}" >> $GITHUB_ENV | |
| echo "BUILD_TYPE=Release" >> $GITHUB_ENV | |
| echo "CMAKE_BUILD_DIR=${BUILD_ROOT}/builddir" >> $GITHUB_ENV | |
| - name: โ๏ธ Setup SSH | |
| uses: webfactory/ssh-agent@v0.10.0 | |
| if: ${{ env.SENTRY_AUTH_TOKEN != '' }} | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_KEY_DEPLOYMENT_CERTIFICATES }} | |
| - name: ๐จ Prepare build env | |
| run: | | |
| brew uninstall cmake | |
| brew install automake bison flex gnu-sed autoconf-archive nasm libtool xcbeautify mono | |
| echo $(brew --prefix bison)/bin >> $GITHUB_PATH | |
| echo $(brew --prefix flex)/bin >> $GITHUB_PATH | |
| echo $(brew --prefix libtool)/bin >> $GITHUB_PATH | |
| - name: ๐ฉ Install CMake and Ninja | |
| uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: 3.31.6 | |
| - name: ๐ญ Setup XCode | |
| uses: maxim-lobanov/setup-xcode@v1.6.0 | |
| with: | |
| xcode-version: 16.2 | |
| - name: ๐ฎ ccache | |
| uses: hendrikmuhs/ccache-action@v1 | |
| with: | |
| key: ccache-${{ matrix.triplet }}-qt6 | |
| max-size: 200M | |
| - name: ๐ Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| - name: ๐ฑ Install dependencies and generate project files | |
| run: | | |
| source ./scripts/version_number.sh | |
| source ./scripts/ci/generate-version-details.sh | |
| cmake -S "${{ github.workspace }}" \ | |
| -B "${CMAKE_BUILD_DIR}" \ | |
| -G Xcode \ | |
| -D CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ | |
| -D WITH_VCPKG=ON \ | |
| -D WITH_NFC=OFF \ | |
| -D WITH_SPIX=ON \ | |
| -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 MACOS_CODE_SIGN_IDENTITY="Apple Development" \ | |
| -D CMAKE_CXX_VISIBILITY_PRESET=hidden \ | |
| -D CMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.deployment-target }} \ | |
| -D CMAKE_OSX_ARCHITECTURES=${{ matrix.target-arch }} \ | |
| -D VCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \ | |
| -D WITH_CCACHE=ON \ | |
| -D VCPKG_INSTALL_OPTIONS="--x-abi-tools-use-exact-versions" | |
| - name: ๐ Build | |
| run: | | |
| # https://www.reddit.com/r/MacOS/comments/f37ybt/osascript_cant_open_default_scripting_component/?utm_medium=android_app&utm_source=share | |
| sudo rm -rf /Library/Audio/Plug-Ins/Components | |
| set -o pipefail | |
| cmake --build "${{ env.CMAKE_BUILD_DIR }}" --config ${{ env.BUILD_TYPE }} | xcbeautify | |
| - name: ๐งซ Test | |
| if: ${{ matrix.run-tests == true }} | |
| env: | |
| PROJ_LIB: ${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed/${{ matrix.triplet }}/share/proj | |
| QFIELD_SYSTEM_SHARED_DATA_PATH: ${{ env.CMAKE_BUILD_DIR }}/vcpkg_installed/${{ matrix.triplet }}/share | |
| run: | | |
| pip install -r "${{ github.workspace }}/test/spix/requirements.txt" | |
| cd "${{ env.CMAKE_BUILD_DIR }}" | |
| ctest --output-on-failure -R smoke -C ${{ env.BUILD_TYPE }} | |
| - name: ๐ฆ Prepackage | |
| run: | | |
| DESTDIR=staging cmake --install "${{ env.CMAKE_BUILD_DIR }}" --config ${{ env.BUILD_TYPE }} | |
| - name: Archive app | |
| run: | | |
| gtar -cpvzf qfield-app-${{ matrix.triplet }}.tar.gz staging | |
| - name: ๐ฆ Upload package | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: qfield-app-${{ matrix.triplet }} | |
| path: qfield-app-${{ matrix.triplet }}.tar.gz | |
| - name: ๐ Upload test report | |
| if: ${{ matrix.run-tests == true && always() }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: "test-report-${{ matrix.triplet }}-${{ env.BUILD_TYPE }}" | |
| path: "${{ env.CMAKE_BUILD_DIR }}/report" | |
| - name: ๐ Upload logs | |
| uses: actions/upload-artifact@v7 | |
| if: failure() | |
| with: | |
| name: logs-${{ matrix.triplet }} | |
| path: | | |
| ${{ env.CMAKE_BUILD_DIR }}/**/*.log | |
| - name: ๐ Setup ruby | |
| uses: ruby/setup-ruby@v1 | |
| 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 debug symbols | |
| if: ${{ env.SENTRY_AUTH_TOKEN != '' }} | |
| # if: release or labeled PR | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| 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.app | |
| create-dmg: | |
| name: Create dmg | |
| runs-on: macos-15 | |
| needs: build | |
| steps: | |
| - name: ๐ฃ Checkout | |
| uses: actions/checkout@v6 | |
| - name: ๐จ Prepare build env | |
| run: | | |
| brew install create-dmg | |
| - name: ๐ค Download app | |
| uses: actions/download-artifact@v8 | |
| with: | |
| pattern: qfield-app-* | |
| path: | | |
| artifacts | |
| - name: Create universal app | |
| run: | | |
| mkdir -p x64 | |
| gtar --strip-components=4 -zxf ./artifacts/qfield-app-x64-osx/qfield-app-x64-osx.tar.gz -C x64 | |
| mkdir -p arm64 | |
| gtar --strip-components=4 -zxf ./artifacts/qfield-app-arm64-osx/qfield-app-arm64-osx.tar.gz -C arm64 | |
| pip install lipomerge | |
| lipomerge ./x64 ./arm64 universal | |
| - name: Create dmg | |
| run: | | |
| if [[ "${{ github.event_name }}" == "release" && "${{ github.ref }}" == refs/tags/v* ]]; then | |
| echo "${{ secrets.APPLE_DEVELOPER_ID_P12_BASE64 }}" | base64 --decode > cert.p12 | |
| export P12_PATH=cert.p12 | |
| export P12_PASSWORD=${{ secrets.APPLE_DEVELOPER_ID_P12_PASSWORD }} | |
| export API_KEY_ID=${{ secrets.IOS_APPSTORE_KEY_ID }} | |
| export API_KEY_ISSUER_ID=${{ secrets.IOS_APPSTORE_ISSUER_ID }} | |
| echo "${{ secrets.IOS_APPSTORE_PRIVATE_KEY }}" > authkey.p8 | |
| export API_KEY_PATH=authkey.p8 | |
| fi | |
| export APP_PATH=$(pwd)/universal/qfield.app | |
| export DMG_PATH=qfield.dmg | |
| ./platform/macos/create_dmg.sh | |
| echo "ARTIFACT_PACKAGE_NAME=qfield-dmg" >> $GITHUB_ENV | |
| - name: ๐ค Upload app | |
| uses: actions/upload-artifact@v7 | |
| id: artifact-macos | |
| with: | |
| name: ${{ env.ARTIFACT_PACKAGE_NAME }} | |
| path: | | |
| *.dmg | |
| - name: Schedule download comment | |
| uses: ./.github/actions/post_sticky_comment | |
| if: github.event_name == 'pull_request' | |
| with: | |
| marker: macos | |
| body: | | |
| ### ๐ MacOS DMG universal builds | |
| Download a [MacOS DMG universal build of this PR for testing](https://nightly.link/opengisch/QField/actions/runs/${{ github.run_id }}/${{ env.ARTIFACT_PACKAGE_NAME }}.zip). | |
| *(Built from commit ${{ github.event.pull_request.head.sha }})* | |
| pr: ${{ github.event.number }} | |
| - name: ๐ Upload release asset | |
| if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') | |
| uses: shogo82148/actions-upload-release-asset@v1 | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: "qfield.dmg" | |
| asset_name: qfield-${{ github.ref_name }}-macos.dmg | |
| overwrite: true |