1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2026-02-08 00:32:27 +00:00

Add build script for macos dmgs.

This commit is contained in:
Filippo Scognamiglio
2026-01-17 18:43:52 +01:00
parent 5795aeb6b7
commit c54dcb1c1c
4 changed files with 82 additions and 1 deletions

44
.github/workflows/build-dmg.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: Build DMG
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
build-dmg:
name: Build (macOS, DMG)
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.10.*
modules: qtshadertools
setup-python: false
cache: true
- name: Build DMG
run: |
JOBS="$(sysctl -n hw.ncpu)"
./scripts/build-dmg.sh
- name: Collect artifact
run: |
mkdir -p release
mv ./*.dmg release/
- name: Attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: ./release/*
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cool-retro-term-dmg
path: ./release/*

1
.gitignore vendored
View File

@@ -54,3 +54,4 @@ build
.DS_Store
*.app
*.dmg

36
scripts/build-dmg.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -euo pipefail
set -x
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
OLD_CWD="$(pwd -P)"
BUILD_DIR="$REPO_ROOT/build/dmg"
APP="cool-retro-term.app"
QML_DIR="$REPO_ROOT/app/qml"
JOBS="${JOBS:-$(sysctl -n hw.ncpu 2>/dev/null || echo 4)}"
if ! command -v qmake >/dev/null; then
echo "qmake not found in PATH." >&2
exit 1
fi
QT_DIR="${QT_DIR:-$(qmake -query QT_INSTALL_PREFIX)}"
QT_BIN="${QT_DIR%/}/bin"
mkdir -p "$BUILD_DIR"
rm -f "$BUILD_DIR/${APP%.app}.dmg"
pushd "$BUILD_DIR"
"$QT_BIN/qmake" CONFIG+=release "$REPO_ROOT/cool-retro-term.pro"
make -j"$JOBS"
PLUGIN_DST="$APP/Contents/PlugIns/qmltermwidget"
rm -rf "$PLUGIN_DST"
mkdir -p "$APP/Contents/PlugIns"
cp -R qmltermwidget/QMLTermWidget "$PLUGIN_DST"
export QML_IMPORT_PATH="$PWD/$APP/Contents/PlugIns"
"$QT_BIN/macdeployqt" "$APP" -qmldir="$QML_DIR" -dmg
rm -f "$APP/Contents/PlugIns/sqldrivers/"libqsql{odbc,psql,mimer}.dylib 2>/dev/null || true
mv "$BUILD_DIR/${APP%.app}.dmg" "$OLD_CWD/"
popd