Skip to content

Commit

Permalink
CI: create/upload dmg file on macOS pipeline for x64/arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
HuguesDelorme committed Jan 24, 2025
1 parent 8e92eda commit 25d5a24
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,30 @@ jobs:
build-macos:
strategy:
matrix:
include:
- qt_version: 5.15
- qt_version: 6.7
- qt_version: [5.15, 6.7]
- os: [macos-latest-large, macos-latest-xlarge]

runs-on: macos-latest
runs-on: ${{matrix.os}}
name: build-macos-qt${{matrix.qt_version}}

steps:
- name: Set environment variables
- name: Set globals
id: globals
run: |
echo QT_VERSION_MAJOR=$(echo ${{matrix.qt_version}} | cut -d. -f1) >> $GITHUB_ENV
QT_VERSION_MAJOR=$(echo ${{matrix.qt_version}} | cut -d. -f1)
echo qt_version_major=$QT_VERSION_MAJOR >> ${GITHUB_OUTPUT}
echo qt_path=$(brew --prefix qt@$QT_VERSION_MAJOR) >> ${GITHUB_OUTPUT}
if [[ ${{matrix.os}} =~ "-large" ]]; then
echo arch=x64 >> ${GITHUB_OUTPUT}
elif [[ ${{matrix.os}} =~ "-xlarge" ]]; then
echo arch=arm64 >> ${GITHUB_OUTPUT}
fi
- name: Checkout
uses: actions/checkout@v2

- name: Install Qt
run: brew install qt@$QT_VERSION_MAJOR
run: brew install qt@${{steps.globals.outputs.qt_version_major}}

- name: Install OpenCascade
run: brew install opencascade
Expand All @@ -36,14 +43,13 @@ jobs:

- name: Build
run: |
echo QT_VERSION_MAJOR=$QT_VERSION_MAJOR
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
cmake --version
cmake .. \
-DMayo_BuildTests=ON \
-DMayo_BuildPluginAssimp=ON \
-DQT_DIR=$(brew --prefix qt@$QT_VERSION_MAJOR)/lib/cmake/Qt$QT_VERSION_MAJOR
-DQT_DIR=${{steps.globals.outputs.qt_path}}/lib/cmake/Qt${{steps.globals.outputs.qt_version_major}}
cmake --build . \
--config Release \
--parallel ${{steps.cpu-cores.outputs.count}}
Expand All @@ -54,16 +60,18 @@ jobs:
./mayo.app/Contents/MacOS/mayo --runtests
- name: Create dmg file
if: ${{steps.globals.outputs.qt_version_major}} == '6'
working-directory: ${{github.workspace}}/build
run: |
$(brew --prefix qt@$QT_VERSION_MAJOR)/bin/macdeployqt mayo.app -dmg
mv mayo.dmg Mayo-0.9.0-macOS-arm64.dmg
${{steps.globals.outputs.qt_path}}/bin/macdeployqt mayo.app -dmg
mv mayo.dmg Mayo-0.9.0-macOS-${{steps.globals.outputs.arch}}.dmg
- name: Upload dmg file
if: ${{steps.globals.outputs.qt_version_major}} == '6'
uses: actions/upload-artifact@v4
with:
name: Mayo-0.9.0-macOS-arm64-dmg
name: Mayo-0.9.0-macOS-${{steps.globals.outputs.arch}}-dmg
path: |
${{github.workspace}}/build/Mayo-0.9.0-macOS-arm64.dmg
#${{github.workspace}}/build/MayoConv-0.9.0-macOS-arm64.dmg
${{github.workspace}}/build/Mayo-0.9.0-macOS-${{steps.globals.outputs.arch}}.dmg
#${{github.workspace}}/build/MayoConv-0.9.0-macOS-${{steps.globals.outputs.arch}}.dmg

0 comments on commit 25d5a24

Please sign in to comment.