Skip to content
Draft
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Release

# Builds Linux AppImages (x86_64 + aarch64) and the Windows NSIS installer with
# sqgipkg, then publishes them as release assets for tags like `4.2.1`.

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:

permissions:
contents: write

env:
APPIMAGE_EXTRACT_AND_RUN: '1'

jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout Jorts
uses: actions/checkout@v4
with:
path: jorts

- name: Checkout sqgi (runtime + sqgipkg)
uses: actions/checkout@v4
with:
repository: supercamel/sqgi
ref: v0.1.0-alpha.1
path: sqgi

- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential cmake ninja-build pkg-config git file ca-certificates wget \
meson valac gobject-introspection gettext desktop-file-utils appstream \
libglib2.0-dev libgirepository1.0-dev libffi-dev libcairo2-dev \
libgtk-4-dev libgranite-7-dev libgee-0.8-dev libjson-glib-dev libportal-dev \
librsvg2-dev librsvg2-common adwaita-icon-theme hicolor-icon-theme shared-mime-info \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu qemu-user-static binfmt-support \
mingw-w64 nsis squashfs-tools

- name: Build and install sqgi
run: |
cmake -S sqgi -B sqgi/build -G Ninja -DCMAKE_BUILD_TYPE=Release -DSQ_ENABLE_JIT=ON
cmake --build sqgi/build
sudo cmake --install sqgi/build --prefix /usr/local
sudo ldconfig

- name: Build Linux x86_64 AppImage
working-directory: jorts
run: sqgipkg --target appimage --appimage-arch x86_64 --sqgi-source-dir "$GITHUB_WORKSPACE/sqgi"

- name: Build Linux aarch64 AppImage
working-directory: jorts
run: sqgipkg --target appimage --appimage-arch aarch64 --sqgi-source-dir "$GITHUB_WORKSPACE/sqgi"

- name: Build Windows installer
working-directory: jorts
run: sqgipkg --target win-nsis --sqgi-source-dir "$GITHUB_WORKSPACE/sqgi"

- name: Collect artifacts
working-directory: jorts
run: |
mkdir -p artifacts
cp dist-linux-x86_64/Jorts.AppImage artifacts/Jorts-x86_64.AppImage
cp dist-linux-aarch64/Jorts.AppImage artifacts/Jorts-aarch64.AppImage
cp dist-windows-x86_64/Jorts-Setup.exe artifacts/Jorts-Setup.exe
ls -lh artifacts

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: jorts-builds
path: jorts/artifacts/*

- name: Publish release assets
if: startsWith(github.ref, 'refs/tags/')
working-directory: jorts
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$GITHUB_REF_NAME" artifacts/* \
--repo "$GITHUB_REPOSITORY" \
--title "$GITHUB_REF_NAME" \
--generate-notes \
|| gh release upload "$GITHUB_REF_NAME" artifacts/* \
--repo "$GITHUB_REPOSITORY" --clobber
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
!.gitignore
!.valalintignore
!.editorconfig
!.github/
!.github/workflows/
!.github/workflows/*.yml
~*
*~
builddir
build
build-*
dist-*
.sqgipkg/
repo
deploy
deploy
30 changes: 24 additions & 6 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,28 @@ gresource_file = configure_file(
configuration: config_data,
)

gresource = gnome.compile_resources(
'gresource',
gresource_file,
source_dir: '.'
glib_compile_resources = find_program('glib-compile-resources', native: true)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this block confuses me. Is it to avoid using gnome.compile_resources? Why?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, this one is to avoid gnome.compile_resources. it breaks in the sqgipkg mingw cross-build.

what happens is meson’s gnome module tries to find glib-compile-resources via gio-2.0.pc. in the windows cross environment, that resolves through the msys2 gio-2.0.pc, which points at glib-compile-resources without .exe. msys2 actually ships glib-compile-resources.exe, so meson falls over during setup.

for gresources we only need the build-machine tool anyway. it generates gresource.c, then that c file is compiled for the windows target.

so this uses:

find_program('glib-compile-resources', native: true)

to explicitly use the host tool and avoid the broken mingw pkg-config tool path.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhhh thank you


# gnome.compile_resources() asks gio-2.0.pc for this tool first. During
# MinGW cross builds sqgipkg exposes the Windows .pc files to pkg-config, and
# MSYS2 advertises this helper without the .exe suffix, so use the build
# machine tool directly.
gresource = custom_target(
'gresource_c',
input: gresource_file,
output: 'gresource.c',
command: [
glib_compile_resources,
'@INPUT@',
'--sourcedir', meson.current_source_dir(),
'--internal',
'--generate',
'--target', '@OUTPUT@'
],
depend_files: files(
'Application.css',
'Themes.css',
),
)

#========================
Expand All @@ -31,7 +49,7 @@ install_data(
install_dir: get_option('datadir') / 'glib-2.0' / 'schemas',
)

compile_schemas = find_program('glib-compile-schemas', required: false)
compile_schemas = find_program('glib-compile-schemas', native: true, required: false)
if compile_schemas.found()
test('Validate schema file', compile_schemas, args: ['--strict', '--dry-run', meson.current_source_dir()])
endif
Expand Down Expand Up @@ -101,4 +119,4 @@ if not windows
test('Validate appstream file', appstreamcli, args: ['validate', '--pedantic', '--no-net', '--explain', appstream_file])
endif

endif
endif
114 changes: 113 additions & 1 deletion docs/development/packagings.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,119 @@ Idk how to do that, havent looked into it and not sure if worth it.

## Appimage

Idk how to do that, havent looked into it and not sure if worth it.
AppImages are built by the sqgipkg release path below.


## sqgipkg release path

Jorts has a `sqgipkg.json` manifest and a GitHub release workflow that builds:

- `dist-linux-x86_64/Jorts.AppImage`
- `dist-linux-aarch64/Jorts.AppImage`
- `dist-windows-x86_64/Jorts-Setup.exe`

This is release plumbing, not a replacement for Meson.

Meson should still own as much of the app build as possible:

- project version, app id, app path, and generated `Config.vala`
- gresource, gschema, desktop, metainfo, and translations
- the Windows executable resources
- the manual Windows `deploy.sh` and NSIS template in `windows/`
- compiling the app itself

sqgipkg plugs into that by calling Meson, then staging the runtime bits that a
portable bundle needs. In other words: if another packaging method appears
later, it should still be able to start from the Meson build without needing to
copy sqgipkg-specific logic.

The manifest currently does this:

- Builds Linux AppImages for x86_64 and aarch64 from Ubuntu noble package data.
- Builds GTK and Granite from pinned upstream tags for the Linux AppImage path,
so the AppImages do not depend on whatever Granite/GTK version the CI host has.
- Builds the Windows executable with Meson and MinGW, then stages MSYS2 runtime
packages into a Windows directory and wraps that directory in an NSIS installer
using the `nsis_options` in `sqgipkg.json`.
- Stages GTK settings, schemas, themes, icon themes, pixbuf SVG loading support,
fonts, app icons, and the app metadata needed by the bundles.

Important icon/theme detail: the app uses the elementary GTK stylesheet on all
platforms, but Windows uses the Adwaita icon theme. The Windows split avoids
elementary symbolic SVGs that GTK's Windows renderer can resolve but fails to
draw. If icons disappear while the theme still works, check `sqgipkg.json`
first:

- Linux package lists should include `elementary-icon-theme`.
- Windows package lists should include `mingw-w64-x86_64-adwaita-icon-theme`
and `mingw-w64-x86_64-adwaita-icon-theme-legacy`.
- Both bundles also need SVG icon loading support (`librsvg`/gdk-pixbuf loader
data), because many symbolic icons are SVG files. On Windows, keep
`mingw-w64-x86_64-gdk-pixbuf2` explicit so the bundle includes
`gdk-pixbuf-query-loaders.exe` for the runtime loader cache.
- Windows also stages `windows/loaders.cache` into
`lib/gdk-pixbuf-2.0/2.10.0/loaders.cache`. Without that default cache, direct
launches can resolve icon names but fail to decode SVG toolbar icons.

### Local build commands

The release workflow checks out sqgi at `v0.1.0-alpha.1`. For local testing,
use the same checkout or pass the same source directory that CI uses:

```bash
git clone --branch v0.1.0-alpha.1 https://github.com/supercamel/sqgi.git ../sqgi
cmake -S ../sqgi -B ../sqgi/build -G Ninja -DCMAKE_BUILD_TYPE=Release -DSQ_ENABLE_JIT=ON
cmake --build ../sqgi/build
sudo cmake --install ../sqgi/build --prefix /usr/local
sudo ldconfig
```

Then from the Jorts source tree:

```bash
sqgipkg --target appimage --appimage-arch x86_64 --sqgi-source-dir ../sqgi
sqgipkg --target appimage --appimage-arch aarch64 --sqgi-source-dir ../sqgi
sqgipkg --target win-nsis --sqgi-source-dir ../sqgi
```

For quicker Windows debugging, build only the staged directory:

```bash
sqgipkg --target win-dir --sqgi-source-dir ../sqgi
```

That writes `dist-windows-x86_64/Jorts`, which is easier to inspect than the
installer. For example, if Windows icons are broken, check that
`dist-windows-x86_64/Jorts/share/icons/elementary` exists and that
`dist-windows-x86_64/Jorts/etc/gtk-4.0/settings.ini` says
`gtk-icon-theme-name=elementary`.

### GitHub release workflow

The release workflow lives at `.github/workflows/release.yml`.

It runs on plain version tags like `4.2.1`. Jorts release tags are `x.y.z`,
not `vX.Y.Z`.

The workflow:

1. Checks out Jorts.
2. Checks out sqgi at `v0.1.0-alpha.1`.
3. Builds and installs sqgi/sqgipkg.
4. Runs sqgipkg for both Linux AppImages and the Windows NSIS installer.
5. Uploads the artifacts.
6. Creates or updates the GitHub release for the tag.

To trigger a release build, push a plain version tag:

```bash
git tag -a 4.2.1 -m "4.2.1"
git push origin 4.2.1
```

For test runs, prefer a temporary branch or workflow dispatch when possible.
If a real version tag is reused for testing, remember that force-moving tags can
confuse anyone watching releases.


## DEB/RPM/etc
Expand Down
17 changes: 16 additions & 1 deletion docs/development/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@ pacman -S --noconfirm meson gcc ninja mingw-w64-x86_64-desktop-file-utils mingw-
It is built so as to not need admin rights. You can distribute as is.


## Automated release build

The GitHub release workflow does not run `windows/deploy.sh` directly. It uses
the sqgipkg release path documented in [packagings.md](packagings.md).

That path still lets Meson build and configure the app, including the Windows
resource file. sqgipkg then stages the MinGW/MSYS2 runtime files, GTK settings,
icon themes, schemas, fonts, and app assets into `dist-windows-x86_64/Jorts`,
before producing `dist-windows-x86_64/Jorts-Setup.exe`.

If the Windows theme works but icons are missing, first check that the staged
directory contains `share/icons/elementary` and that the bundled GTK settings
still say `gtk-icon-theme-name=elementary`. The theme package and icon theme
package are separate things.


## Known issues deploying

Expand Down Expand Up @@ -95,4 +110,4 @@ The Installer sets it once, then it is between you and God.
Windows has to load a lot of libraries Linux kinda has loaded already by default.

- XDG_DATA_DIRS points to the root of where apps dump their configurations. It isnt sandboxed.
There is a vala flag to create a folder to put data in
There is a vala flag to create a folder to put data in
14 changes: 8 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@ if windows
subdir('windows')
endif

gnome.post_install(
glib_compile_schemas: true,
gtk_update_icon_cache: true,
update_desktop_database: true
)
if not windows
gnome.post_install(
glib_compile_schemas: true,
gtk_update_icon_cache: true,
update_desktop_database: true
)
endif

if development
message('''
Expand All @@ -113,4 +115,4 @@ Tread carefully.
----------------------------------------
''')
endif
endif
Loading