Skip to content

.github/workflows/build.yml #4

.github/workflows/build.yml

.github/workflows/build.yml #4

Workflow file for this run

name: Build macOS & Linux
on:
push:
tags:
- 'v*'
jobs:
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.4.2'
target: 'desktop'
modules: 'qtserialport'
- name: Generate square icon from source
run: |
sips -z 256 256 qMonstatek.png --out src/resources/icons/app_icon.png
- name: Generate macOS icon
run: bash src/resources/icons/generate_icns.sh
- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DAPP_UPDATE_REPO=${GITHUB_REPOSITORY}
- name: Build
run: cmake --build build --parallel
- name: Deploy
run: cmake --install build/ --prefix package
- name: Create DMG
run: |
hdiutil create -volname "qMonstatek" \
-srcfolder package \
-ov -format UDZO \
"qMonstatek_${GITHUB_REF_NAME}.dmg"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: macos-dmg
path: qMonstatek_*.dmg
build-linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libfuse2 libxkbcommon-dev libxkbcommon-x11-0 imagemagick libssl-dev
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.4.2'
target: 'desktop'
modules: 'qtserialport'
- name: Generate 256x256 icon from source
run: |
convert qMonstatek.png -resize 256x256! -background transparent -gravity center -extent 256x256 src/resources/icons/qmonstatek.png
- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DAPP_UPDATE_REPO=${GITHUB_REPOSITORY} -DCMAKE_INSTALL_PREFIX=/usr
- name: Build
run: cmake --build build --parallel
- name: Install
run: DESTDIR=AppDir cmake --install build
- name: Download linuxdeploy
run: |
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget -q https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x linuxdeploy*.AppImage
- name: Create AppImage
env:
QML_SOURCES_PATHS: src/qml
EXTRA_QT_PLUGINS: tls
run: |
./linuxdeploy-x86_64.AppImage \
--appdir AppDir \
--desktop-file src/resources/linux/qmonstatek.desktop \
--icon-file src/resources/icons/qmonstatek.png \
--plugin qt \
--output appimage
mv qMonstatek*.AppImage "qMonstatek_${GITHUB_REF_NAME}.AppImage"
- name: Zip AppImage
run: zip "qMonstatek_${GITHUB_REF_NAME}_linux.zip" "qMonstatek_${GITHUB_REF_NAME}.AppImage"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: linux-appimage
path: qMonstatek_*_linux.zip
release:
needs: [build-macos, build-linux]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download macOS artifact
uses: actions/download-artifact@v4
with:
name: macos-dmg
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: linux-appimage
- name: Upload to release
uses: softprops/action-gh-release@v2
with:
files: |
qMonstatek_*.dmg
qMonstatek_*_linux.zip