Fix formatting again #6152
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 Build | |
| on: | |
| push: | |
| paths: | |
| - 'vcpkg/**' | |
| - 'vcpkg.json' | |
| - 'VCPKG_BASELINE' | |
| - 'app/**' | |
| - 'core/**' | |
| - 'scripts/**' | |
| - 'cmake/**' | |
| - 'cmake_templates/**' | |
| - 'test/**' | |
| - 'CMakeLists.txt' | |
| - '.github/workflows/macos.yml' | |
| release: | |
| types: | |
| - published | |
| env: | |
| CMAKE_VERSION: '3.31.6' | |
| VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' | |
| VCPKG_ROOT: '${{ github.workspace }}/vcpkg' | |
| XC_VERSION: ${{ '16.4' }} | |
| DEPLOYMENT_TARGET: '11.0' | |
| TRIPLET: arm64-osx | |
| concurrency: | |
| group: ci-${{github.ref}}-macos | |
| cancel-in-progress: true | |
| jobs: | |
| macos_build: | |
| if: ( github.repository == 'MerginMaps/mobile' ) && (!contains(github.event.head_commit.message, 'Translate ')) | |
| runs-on: macos-15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| path: mm | |
| - name: Install brew deps | |
| run: | | |
| brew uninstall cmake | |
| brew install automake bison flex gnu-sed autoconf-archive libtool gettext lcov openssl create-dmg mono | |
| echo $(brew --prefix bison)/bin >> $GITHUB_PATH | |
| echo $(brew --prefix flex)/bin >> $GITHUB_PATH | |
| echo $(brew --prefix gettext)/bin >> $GITHUB_PATH | |
| - name: Install CMake and Ninja | |
| uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: ${{ env.CMAKE_VERSION }} | |
| - name: Setup XCode | |
| uses: maxim-lobanov/setup-xcode@v1.6.0 | |
| with: | |
| xcode-version: ${{ env.XC_VERSION }} | |
| - name: Extract Mergin API_KEY | |
| env: | |
| MERGINSECRETS_DECRYPT_KEY: ${{ secrets.MERGINSECRETS_DECRYPT_KEY }} | |
| run: | | |
| cd mm/core/ | |
| $HOMEBREW_PREFIX/bin/openssl \ | |
| aes-256-cbc -d \ | |
| -in merginsecrets.cpp.enc \ | |
| -out merginsecrets.cpp \ | |
| -k "$MERGINSECRETS_DECRYPT_KEY" \ | |
| -md md5 | |
| - name: ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: ccache-${{ env.TRIPLET }} | |
| max-size: 200M | |
| - name: Install vcpkg | |
| shell: bash | |
| run: | | |
| mkdir -p "${{ env.VCPKG_ROOT }}" | |
| cd "${{ env.VCPKG_ROOT }}" | |
| git init | |
| git remote add origin https://github.com/microsoft/vcpkg.git | |
| git pull origin master | |
| VCPKG_TAG=`cat ${{ github.workspace }}/mm/VCPKG_BASELINE` | |
| git checkout ${VCPKG_TAG} | |
| cd "${{ env.VCPKG_ROOT }}" | |
| chmod +x ./bootstrap-vcpkg.sh | |
| ./bootstrap-vcpkg.sh | |
| - name: Setup NuGet Credentials | |
| shell: bash | |
| run: | | |
| mono `${{ env.VCPKG_ROOT }}/vcpkg fetch nuget | tail -n 1` \ | |
| sources add \ | |
| -source "https://nuget.pkg.github.com/merginmaps/index.json" \ | |
| -storepasswordincleartext \ | |
| -name "GitHub" \ | |
| -username "mergin-maps-bot" \ | |
| -password "${{ secrets.MERGIN_MAPS_BOT_GITHUB_TOKEN }}" | |
| mono `${{ env.VCPKG_ROOT }}/vcpkg fetch nuget | tail -n 1` \ | |
| setapikey "${{ secrets.MERGIN_MAPS_BOT_GITHUB_TOKEN }}" \ | |
| -source "https://nuget.pkg.github.com/merginmaps/index.json" | |
| - name: Calculate build number | |
| run: | | |
| BUILD_NUM=$GITHUB_RUN_NUMBER$GITHUB_RUN_ATTEMPT | |
| echo "MM_VERSION_CODE=${BUILD_NUM}" >> $GITHUB_ENV | |
| echo "Version code: ${BUILD_NUM}" | |
| - name: build app (debug) | |
| run: | | |
| mkdir -p build-mm-db | |
| cd build-mm-db | |
| cmake \ | |
| -DCMAKE_BUILD_TYPE=Debug \ | |
| -DVCPKG_TARGET_TRIPLET=${{ env.TRIPLET }} \ | |
| -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake \ | |
| -DUSE_MM_SERVER_API_KEY=TRUE \ | |
| -DHAVE_BLUETOOTH=FALSE \ | |
| -DUSE_KEYCHAIN=No \ | |
| -DCOVERAGE=TRUE \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
| -DENABLE_TESTS=TRUE \ | |
| -GNinja \ | |
| -S ../mm | |
| ninja | |
| - name: run tests | |
| run: | | |
| cd build-mm-db/ | |
| ctest --output-on-failure | |
| - name: build app (release) | |
| run: | | |
| mkdir -p install-mm | |
| mkdir -p build-mm-rel | |
| cd build-mm-rel | |
| cmake \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DVCPKG_TARGET_TRIPLET=${{ env.TRIPLET }} \ | |
| -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake \ | |
| -DCMAKE_INSTALL_PREFIX:PATH=../install-mm \ | |
| -DUSE_SERVER_API_KEY=TRUE \ | |
| -DUSE_MM_SERVER_API_KEY=TRUE \ | |
| -DUSE_KEYCHAIN=No \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
| -GNinja \ | |
| -S ../mm | |
| ninja | |
| ninja install | |
| - name: Get TimeStamp | |
| id: time | |
| uses: josStorer/get-current-time@v2.0.2 | |
| with: | |
| format: 'YYYYMMDD' | |
| - 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=${{ github.workspace }}/install-mm/MerginMaps.app | |
| export DMG_PATH=merginmaps-${{ steps.time.outputs.formattedTime }}-${{ github.run_number }}.dmg | |
| ./mm/scripts/create_dmg.sh | |
| - name: Upload dmg | |
| uses: actions/upload-artifact@v4 | |
| id: artifact-macos | |
| with: | |
| name: Mergin Maps ${{ env.MM_VERSION_CODE }} dmg | |
| path: | | |
| *.dmg |