Skip to content

Update macos-dmg.yml #5

Update macos-dmg.yml

Update macos-dmg.yml #5

Workflow file for this run

name: macOS DMG
on:
workflow_dispatch:
push:
branches: [ master ]
tags: [ '[0-9]*.[0-9]*.[0-9]*' ]
pull_request:
paths:
- '.github/workflows/macos-dmg.yml'
- 'meson.build'
- 'data/**'
- 'src/**'
- 'macos/**'
jobs:
build-dmg:
strategy:
matrix:
os: [macos-13, macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Show runner info
run: |
uname -a
sw_vers
sysctl -n machdep.cpu.brand_string || true
- name: Setup Homebrew and dependencies
run: |
brew update-reset
brew install meson ninja pkg-config glib gtk4 libadwaita pygobject3 gtksourceview5 python@3.13 automake
brew --version
brew list --versions
- name: Build gtk-mac-bundler from source
run: |
git clone https://gitlab.gnome.org/GNOME/gtk-mac-bundler.git
cd gtk-mac-bundler
meson setup build --prefix=/usr/local --buildtype=release
meson compile -C build
sudo meson install -C build
which gtk-mac-bundler
gtk-mac-bundler --version || true
- name: Build blueprint-compiler from git (v0.18.0)
run: |
set -euxo pipefail
git clone --depth 1 --branch v0.18.0 https://gitlab.gnome.org/GNOME/blueprint-compiler.git
cd blueprint-compiler
meson setup build --prefix "$PWD/../bp_prefix" --buildtype=release
meson compile -C build
meson install -C build
echo "$GITHUB_WORKSPACE/bp_prefix/bin" >> "$GITHUB_PATH"
- name: Build project (Meson)
run: |
set -euxo pipefail
PY_BIN="$(brew --prefix python@3.13)/bin/python3"
echo "Using Python: ${PY_BIN}"
export PYTHON="${PY_BIN}"
meson setup build --prefix "$PWD/stage" --buildtype=release
meson compile -C build
meson install -C build
- name: Bundle app with gtk-mac-bundler
run: |
mkdir -p macos
# Create bundler recipe if not in repo
cat > macos/ssh-studio.bundle << 'XML'
<?xml version="1.0"?>
<app-bundle>
<id>io.github.BuddySirJava.SSH-Studio</id>
<name>SSH Studio</name>
<version>1.0.0</version>
<icon>data/media/icon_512.png</icon>
<main-binary>
<binary>ssh-studio</binary>
</main-binary>
<resources>
<file>stage/share/io.github.BuddySirJava.SSH-Studio/ssh-studio-resources.gresource</file>
<dir>src</dir>
</resources>
<dependencies>
<dep>gtk4</dep>
<dep>libadwaita</dep>
<dep>gtksourceview5</dep>
<dep>pygobject3</dep>
<dep>python3</dep>
</dependencies>
</app-bundle>
XML
gtk-mac-bundler macos/ssh-studio.bundle
- name: Create DMG
run: |
set -euxo pipefail
VER=$(sed -n "s/.*version: '\([^']*\)'.*/\1/p" meson.build | head -n1)
ARCH=$(uname -m)
mkdir -p dmgroot
cp -R "build/ssh-studio.bundle/SSH Studio.app" dmgroot/
ln -s /Applications dmgroot/Applications
hdiutil create -volname "SSH Studio" -srcfolder dmgroot -ov -fs HFS+ "ssh-studio-${VER}-${ARCH}.dmg"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ssh-studio-dmg-${{ matrix.os }}
path: |
*.dmg