Don't bother with OBS workflow after all #455
This file contains 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: | |
workflow_dispatch: | |
inputs: | |
packageRelease: | |
description: 'Package binaries for release and upload them' | |
required: false | |
default: false | |
jobs: | |
macos: | |
name: macOS desktop (Qt ${{ matrix.qt-version }}) | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
qt-version: ['6.2', '6.4'] | |
steps: | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '${{ matrix.qt-version }}.*' | |
cache: true | |
modules: 'qtnetworkauth' | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Build | |
run: | | |
mkdir build && cd build | |
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. | |
cmake --build . --config RelWithDebInfo | |
cd .. | |
# If Apple didn't insist on bundling apps as folders, this wouldn't be necessary; however, this is done to ensure that the .app folder remains intact | |
- name: Prepare binary for uploading | |
run: | | |
mkdir upload_dir | |
cd upload_dir | |
cp -r ../build/TimeLight.app . | |
cd .. | |
- name: Upload binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: macOS binary (Qt ${{ matrix.qt-version }}) | |
path: upload_dir | |
retention-days: 7 | |
- name: Build release package | |
if: ${{ github.event.inputs.packageRelease || startsWith(github.ref, 'refs/tags/v') }} | |
run: | | |
mkdir release_dir | |
cd release_dir | |
cp -r ../build/TimeLight.app . | |
macdeployqt TimeLight.app -dmg | |
cd .. | |
- name: Upload release package | |
if: ${{ github.event.inputs.packageRelease || startsWith(github.ref, 'refs/tags/v') }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: macOS package (64-bit, Qt ${{ matrix.qt-version }}) | |
path: release_dir/TimeLight.dmg | |
retention-days: 7 |