ci: Update to use macdeployqt6 #50
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: Releases | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: macos-13 | |
DEPLOY_PATH: qhot.dmg | |
- os: ubuntu-latest | |
DEPLOY_PATH: qhot.AppImage | |
- os: windows-latest | |
DEPLOY_PATH: qhot-Windows.zip | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: 6.4.2 | |
target: desktop | |
dir: ${{ runner.temp }} | |
modules: qtcharts | |
setup-python: true | |
- name: Configure | |
run: | | |
cmake -B build -DCMAKE_BUILD_TYPE=Release | |
- name: Build Unix | |
if: runner.os == 'macOS' || runner.os == 'Linux' | |
run: | | |
cmake --build build --parallel --config Release | |
- name: Build Windows | |
if: runner.os == 'Windows' | |
run: | | |
cmake --build build --parallel --target ALL_BUILD --config Release | |
- name: Install LinuxDeploy | |
uses: miurahr/install-linuxdeploy-action@v1 | |
if: runner.os == 'Linux' | |
with: | |
plugins: qt appimage | |
- name: Create dmg | |
if: runner.os == 'macOS' | |
run: | | |
cd build/src | |
macdeployqt6 qhot.app -qmldir=../../qml -dmg | |
cd ../.. | |
cp build/src/qhot.dmg . | |
- name: Create Appimage | |
if: runner.os == 'Linux' | |
run: | | |
# Install lib for linuxdeploy | |
sudo apt install --yes libfuse2 libxkbcommon-x11-0 | |
export QML_SOURCES_PATHS=$PWD/qml | |
linuxdeploy-x86_64.AppImage --desktop-file=deploy/qhot.desktop --executable=build/src/qhot --appdir=build/src --plugin=qt --output=appimage --verbosity=3 --icon-file=deploy/icon.png | |
cp qhot-*.AppImage qhot.AppImage | |
- name: Build Windows | |
if: runner.os == 'Windows' | |
env: | |
OPENSSL: 'C:\Program Files\OpenSSL\bin' | |
SYSTEM32: 'C:\windows\system32' | |
SYSTEM32_DLLS: 'VCRUNTIME140.dll VCRUNTIME140_1.dll MSVCP140.dll MSVCP140_1.dll' | |
run: | | |
mkdir output | |
cp build/Release/qhot.exe output/qhot.exe | |
if (($env:OPENSSL) -and (Test-Path $env:OPENSSL -pathType container)) { | |
Copy-Item ${env:OPENSSL}\*.dll -Destination output -Force | |
} | |
foreach ($I in (${env:SYSTEM32_DLLS} -split ' ')) { copy ${env:SYSTEM32}\$I output\ } | |
windeployqt --qmldir qml --release output/qhot.exe --verbose=2 | |
- name: Zip windows | |
uses: vimtor/action-zip@v1 | |
if: runner.os == 'Windows' | |
with: | |
files: output | |
dest: ${{ matrix.DEPLOY_PATH }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: qhot-${{ runner.os }} | |
path: ${{ matrix.DEPLOY_PATH }} | |
- name: Upload continuous to release | |
uses: svenstaro/upload-release-action@v2 | |
if: ${{ github.event_name != 'pull_request' }} | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{ matrix.DEPLOY_PATH }} | |
tag: continuous | |
overwrite: true | |
prerelease: true | |
- name: Upload release | |
uses: svenstaro/upload-release-action@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{ matrix.DEPLOY_PATH }} | |
tag: ${{ github.ref }} | |
overwrite: true | |
prerelease: true |