use install-qt-static action #23
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
# Modified from (GPL): | |
# https://github.com/travisgoodspeed/maskromtool/blob/master/.github/workflows/build.yml | |
name: Build | |
on: [workflow_dispatch, push] | |
jobs: | |
Build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, macos-latest] | |
include: | |
- os: windows-latest | |
os-caption: windows | |
- os: macos-latest | |
os-caption: macos | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: AllanChain/install-qt-static@main | |
- uses: ilammy/msvc-dev-cmd@v1 | |
if: contains(matrix.os, 'windows') | |
- name: Build Project (Windows) | |
if: contains(matrix.os, 'windows') | |
env: | |
CL: /MP # Build with multiple processes | |
run: | | |
mkdir build | |
cd build | |
qt-cmake.bat -DCMAKE_BUILD_TYPE=MinSizeRel .. | |
msbuild sane-break.sln /property:Configuration=Release -maxcpucount | |
- name: Build Project (macOS) | |
if: contains(matrix.os, 'macos') | |
working-directory: build | |
run: | | |
mkdir build | |
cd build | |
qt-cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" .. | |
make -j3 | |
- name: Packing (Windows) | |
if: contains(matrix.os, 'windows') | |
run: | | |
mkdir release | |
move build\Release\sane-break.exe release | |
- name: Packing (macOs) | |
if: contains(matrix.os, 'macos') | |
run: | | |
mkdir release | |
brew install create-dmg | |
create-dmg \ | |
--volname "Sane Break" \ | |
--hide-extension "sane-break.app" \ | |
--window-size 600 450 \ | |
--icon-size 94 \ | |
--icon "sane-break" 141 249 \ | |
--app-drop-link 458 249 \ | |
"release/sane-break.dmg" \ | |
"build/sane-break.app" | |
- name: Create Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "sane-break (${{matrix.os-caption}})" | |
path: ./release/* |