|
| 1 | +name: mac-os |
| 2 | +on: push |
| 3 | +jobs: |
| 4 | + mac-os: |
| 5 | + strategy: |
| 6 | + fail-fast: false |
| 7 | + matrix: |
| 8 | + version: ['5.15.2', '6.5.3'] |
| 9 | + include: |
| 10 | + - version: '5.15.2' |
| 11 | + qmake-archs: 'x86_64' |
| 12 | + short-qt: '5' |
| 13 | + - version: '6.5.3' |
| 14 | + qmake-archs: 'x86_64 arm64' |
| 15 | + short-qt: '6' |
| 16 | + runs-on: macos-15 |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v1 |
| 19 | + with: |
| 20 | + fetch-depth: 1 |
| 21 | + - name: Install Qt |
| 22 | + uses: jurplel/install-qt-action@v4 |
| 23 | + with: |
| 24 | + version: ${{ matrix.version }} |
| 25 | + arch: 'clang_64' |
| 26 | + cache: true |
| 27 | + - name: Qmake build |
| 28 | + env: |
| 29 | + QMAKE_FLAGS: ${{ matrix.qmake-archs }} |
| 30 | + run: | |
| 31 | + export PATH=$QT_ROOT_DIR/bin/:$PATH |
| 32 | + mkdir build && cd build |
| 33 | + qmake QMAKE_APPLE_DEVICE_ARCHS="${QMAKE_FLAGS}" CONFIG+=sdk_no_version_check -o Makefile ../Datacorn.pro |
| 34 | + make release -j$(nproc) |
| 35 | + - name: Setup directory with artifacts |
| 36 | + run: | |
| 37 | + export PATH=$QT_ROOT_DIR/bin/:$PATH |
| 38 | + export RDIR=Datacorn |
| 39 | + mkdir $RDIR |
| 40 | + macdeployqt build/binary/Datacorn.app |
| 41 | + cp -r build/binary/Datacorn.app Datacorn |
| 42 | + # github actions is bugged https://github.com/actions/runner-images/issues/7522 |
| 43 | + max_tries=10 |
| 44 | + i=0 |
| 45 | + until macdeployqt build/binary/Datacorn.app -dmg |
| 46 | + do |
| 47 | + if [ $i -eq $max_tries ] |
| 48 | + then |
| 49 | + echo 'Error: macdeployqt did not succeed even after 10 tries.' |
| 50 | + exit 1 |
| 51 | + fi |
| 52 | + i=$((i+1)) |
| 53 | + done |
| 54 | + cp build/binary/Datacorn.dmg Datacorn |
| 55 | + - name: Upload artifacts |
| 56 | + uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: Datacorn-macos-qt${{ matrix.short-qt }} |
| 59 | + path: Datacorn/*.app |
| 60 | + - name: Release |
| 61 | + if: ${{ github.ref == 'refs/heads/master' }} |
| 62 | + uses: svenstaro/upload-release-action@v2 |
| 63 | + with: |
| 64 | + overwrite: true |
| 65 | + asset_name: Datacorn-macos-qt${{ matrix.short-qt }}.dmg |
| 66 | + prerelease: true |
| 67 | + tag: | |
| 68 | + latest |
| 69 | + file: | |
| 70 | + Datacorn/Datacorn.dmg |
| 71 | + - name: Log Failure |
| 72 | + uses: sarisia/actions-status-discord@v1 |
| 73 | + if: failure() |
| 74 | + with: |
| 75 | + nodetail: true |
| 76 | + description: | |
| 77 | + [[${{ github.event.repository.name }}] ${{ github.job }} failed on ${{ github.ref }}](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}) |
| 78 | + title: | |
| 79 | +
|
| 80 | + color: 0xff0000 |
| 81 | + webhook: ${{ secrets.DISCORD_WEBHOOK }} |
| 82 | + avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png |
| 83 | + username: Github |
| 84 | + |
| 85 | + Notify-success: |
| 86 | + runs-on: ubuntu-latest |
| 87 | + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} |
| 88 | + needs: [ mac-os ] |
| 89 | + steps: |
| 90 | + - name: Log Success |
| 91 | + uses: sarisia/actions-status-discord@v1 |
| 92 | + with: |
| 93 | + nodetail: true |
| 94 | + description: | |
| 95 | + [[${{ github.event.repository.name }}] Build Datacorn mingw success on ${{ github.ref }}](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}) |
| 96 | + title: | |
| 97 | +
|
| 98 | + color: 0x0f9826 |
| 99 | + webhook: ${{ secrets.DISCORD_WEBHOOK }} |
| 100 | + avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png |
| 101 | + username: Github |
0 commit comments