Graduately/.github/workflows/release.yml
pepaskopec-blip 7d503d6c5b Add installers that fetch the newest release when run.
Each installer carries no application of its own and resolves
/releases/latest/download/ at the moment it runs, so the file never goes
stale and the same download keeps working across future releases.

macOS installs into /Applications, falling back to the user's own folder
when that is not writable, and clears the quarantine flag the unsigned
build would otherwise trip over. Windows extracts over any existing
install rather than replacing the folder, so the progress files kept
inside it survive, and adds a Start menu entry. Linux drops the AppImage
in ~/Applications with a desktop entry and its icon.

Publish the macOS one zipped, because a release asset loses its
executable bit and a .command needs one to be double-clicked.

The .cmd also had to be excluded from the *.cmd ignore rule, which comes
from the kernel section of the template and targets build artifacts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 15:16:46 +02:00

141 lines
3.7 KiB
YAML

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
linux:
name: Linux AppImage
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential pkg-config curl \
libgtk-4-dev librsvg2-dev \
desktop-file-utils \
appstream
- name: Build AppImage
env:
VERSION: ${{ github.ref_name }}
run: |
chmod +x scripts/bundle-linux.sh
./scripts/bundle-linux.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: maturita-linux
path: dist/maturita-linux-*.AppImage
windows:
name: Windows zip
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >-
make
zip
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-gtk4
mingw-w64-ucrt-x86_64-pkg-config
mingw-w64-ucrt-x86_64-make
- name: Build and bundle
env:
VERSION: ${{ github.ref_name }}
run: |
make bundle
cd dist
zip -qry ../maturita-windows-x64.zip .
cd ..
mkdir -p dist-out
mv maturita-windows-x64.zip dist-out/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: maturita-windows
path: dist-out/maturita-windows-x64.zip
macos:
name: macOS app
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install gtk4 pkg-config
- name: Build .app zip
env:
VERSION: ${{ github.ref_name }}
run: |
chmod +x scripts/bundle-macos.sh
./scripts/bundle-macos.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: maturita-macos
path: dist/maturita-macos-*.zip
publish:
name: Publish GitHub Release
needs: [linux, windows, macos]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: release-assets
merge-multiple: true
# The installers carry no application: each downloads the newest release
# when the user runs it. The macOS one is zipped because a release asset
# loses its executable bit, which a .command needs to be double-clicked.
- name: Collect installers
run: |
cp installers/maturita-installer-linux.sh release-assets/
cp installers/maturita-installer-windows.cmd release-assets/
chmod +x installers/maturita-installer-macos.command
(cd installers && zip -q ../release-assets/maturita-installer-macos.zip \
maturita-installer-macos.command)
- name: List assets
run: find release-assets -type f -print
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: |
release-assets/maturita-linux-*.AppImage
release-assets/maturita-windows-x64.zip
release-assets/maturita-macos-*.zip
release-assets/maturita-installer-macos.zip
release-assets/maturita-installer-windows.cmd
release-assets/maturita-installer-linux.sh
generate_release_notes: true
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}