Skip to content

Commit 1183f75

Browse files
committed
Build dmg for Intel
1 parent 7f082e5 commit 1183f75

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/build.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,68 @@ jobs:
220220
path: "*.zip"
221221
if-no-files-found: error
222222

223+
build-mac-intel:
224+
runs-on: macos-13
225+
environment: build
226+
strategy:
227+
matrix:
228+
demo: [false, true]
229+
steps:
230+
- name: Checkout repository
231+
uses: actions/checkout@v4
232+
with:
233+
fetch-depth: 0
234+
235+
- name: Get latest tag version
236+
run: echo "PACKAGE_VERSION=$(git describe --tags --abbrev=0 || echo 0.0.0)" >> "$GITHUB_ENV"
237+
238+
- name: Apply patch
239+
if: matrix.demo == true
240+
run: |
241+
git config --global user.name "github-actions[bot]"
242+
git config --global user.email "[email protected]"
243+
git diff --binary origin/main...origin/demo > demo.patch
244+
git apply demo.patch
245+
246+
- name: Install Qt
247+
uses: jurplel/install-qt-action@v4
248+
with:
249+
version: ${{ env.QT_VERSION }}
250+
modules: 'qtwebsockets qthttpserver'
251+
252+
- name: Compile
253+
run: |
254+
mkdir -p build && cd build/
255+
qmake "../src/${{ env.APP_NAME }}.pro" CONFIG+="${{ env.BUILD_TYPE }}" PACKAGE_VERSION="${{ env.PACKAGE_VERSION }}"
256+
make "-j$(sysctl -n hw.ncpu)"
257+
258+
- name: Deploy
259+
run: |
260+
mv "build/${{ env.APP_NAME }}.app" "build/${{ env.APP_LABEL }}.app"
261+
macdeployqt "build/${{ env.APP_LABEL }}.app" -dmg -verbose=2
262+
263+
- run: mv "build/${{ env.APP_LABEL }}.dmg" "${{ env.APP_LABEL }}-${{ env.PACKAGE_VERSION }}${{ matrix.demo && '-demo-macos' || '' }}-intel.dmg"
264+
265+
- name: Zip builds
266+
if: matrix.demo == false
267+
run: zip -r -P "${{ secrets.ZIP_PASSWORD }}" "${{ env.APP_NAME }}-${{ env.PACKAGE_VERSION }}.zip" "${{ env.APP_LABEL }}-${{ env.PACKAGE_VERSION }}${{ matrix.demo && '-demo-macos' || '' }}-intel.dmg"
268+
269+
- name: Upload artifacts (demo)
270+
if: matrix.demo == true
271+
uses: actions/upload-artifact@v4
272+
with:
273+
name: ${{ env.APP_NAME }}-artifacts-mac-intel-demo
274+
path: "*.dmg"
275+
if-no-files-found: error
276+
277+
- name: Upload artifacts
278+
if: matrix.demo == false
279+
uses: actions/upload-artifact@v4
280+
with:
281+
name: ${{ env.APP_NAME }}-artifacts-mac-intel
282+
path: "*.zip"
283+
if-no-files-found: error
284+
223285
build-windows:
224286
runs-on: windows-latest
225287
environment: build

0 commit comments

Comments
 (0)