ci(github): publish releases

The Komorebi License lets anyone distribute the source code but not binaries, so
the flake has no public binary cache and the binaries of komorebi come only from
this repository. The `build` job builds `komorebi` and `komorebic` with nix on
every run, on ubuntu-24.04 and on ubuntu-24.04-arm, and keeps them as an
artifact for 14 days; the arm64 job is `continue-on-error`.

As nix builds them, the binaries load libc, libm and libgcc_s through the
dynamic loader of the store and an RPATH into it, which only a machine with the
same nixpkgs revision in its store has. The job points them at the system's
loader at its standard path and drops the RPATH, with patchelf from the nixpkgs
flake.lock pins, then runs `--version` on the Ubuntu runner to check that they
start. Built from the locked nixpkgs (d3b13ad), the newest glibc symbol version
they need is 2.39, the glibc of Ubuntu 24.04.

The `publish` job runs on a `v*` tag, and on a scheduled or manual run on
master, once lint, vm-fast and build have passed. It zips the two binaries of
each architecture as `komorebi-<version>-<target>.zip` (an architecture whose
build failed is left out with a warning), adds schema.json, the schema of
komorebi.json, when the repository has one (it does), and writes checksums.txt
with sha256sum. The release notes are kokai's, from the commit messages since
the previous version tag, as komorebi for Mac writes them; kokai is not in
nixpkgs, so cargo installs it, pinned at 0.3.1. A tag becomes a release. master
replaces the rolling `nightly` prerelease and its tag; the old nightly tag is
moved to the commit first, so that the notes list the commits since the last
version and not since the last nightly. There is no Homebrew, winget or second
repository.

The cache key of the composite action gets the runner's architecture: the arm64
runner has the same `runner.os` as the x86_64 one, and would restore and save
the other's store.

The steps were run as written on aarch64 and x86_64 machines: the builds, whose
binaries then started in Ubuntu 24.04 root filesystems of both architectures,
and a first nightly, a later nightly and a tag release against a fake gh. GitHub
Actions has not run them yet. CONTRIBUTING.md says how a release is made, the
README where binaries come from and what the license allows, and DESIGN.md why.
The pages that said there were no prebuilt binaries (README, installation.md and
the entry on the binary cache in DESIGN.md) now say that the releases are the
only ones.
This commit is contained in:
LGUG2Z committed 2026-10-28 07:39:49 -07:00
1 parent 70c2affa9d
commit 01179af18d
6 files changed
+190 -11

No files matched your search

+4 -3
View File
@@ -42,10 +42,11 @@ runs:
# The key is flake.lock, so a job that builds against another nixpkgs (the canary) turns the
# cache off: what it restored would be of no use to it, and what it saved would replace the
# store of the jobs that do use this lock.
# store of the jobs that do use this lock. The architecture is part of the key, because the
# x86_64 and arm64 runners build different store paths.
- if: inputs.cache == 'true'
uses: nix-community/cache-nix-action@v7
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.lock', '**/Cargo.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
primary-key: nix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('flake.lock', '**/Cargo.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-${{ runner.arch }}-
gc-max-store-size-linux: 8G
+116
View File
@@ -206,3 +206,119 @@ jobs:
gh issue create --repo "$GITHUB_REPOSITORY" --title "$title" \
--body-file "$RUNNER_TEMP/canary.md"
fi
# komorebi and komorebic for each architecture, kept for 14 days, and what the publish job
# releases. nix points a binary at the dynamic loader and the libraries of its store, which only a
# machine with those store paths has, so each binary is pointed at the system's loader instead,
# at the path every glibc system has it, and run on this Ubuntu runner to show that it works.
# The arm64 job may fail without failing the run.
build:
if: github.repository == 'LGUG2Z/komorebi-for-kde'
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
runs-on: ubuntu-24.04
loader: /lib64/ld-linux-x86-64.so.2
optional: false
- target: aarch64-unknown-linux-gnu
runs-on: ubuntu-24.04-arm
loader: /lib/ld-linux-aarch64.so.1
optional: true
runs-on: ${{ matrix.runs-on }}
continue-on-error: ${{ matrix.optional }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/nix
- name: Build komorebi and komorebic
env:
LOADER: ${{ matrix.loader }}
run: |
mkdir bin
for name in komorebi komorebic; do
cp "$(nix build -L --no-link --print-out-paths ".#$name")/bin/$name" bin/
done
chmod u+w bin/*
nix run --inputs-from . nixpkgs#patchelf -- --set-interpreter "$LOADER" --remove-rpath bin/*
echo "the newest glibc symbol version they need:" \
"$(objdump -T bin/* | grep -o 'GLIBC_[0-9.]*' | sort -uV | tail -n 1)"
bin/komorebi --version
bin/komorebic --version
- uses: actions/upload-artifact@v7
with:
name: komorebi-${{ matrix.target }}-${{ github.sha }}
path: bin/
retention-days: 14
# A push of a `v*` tag makes a release of what the build job made, and a scheduled or manual run
# on master replaces the rolling `nightly` prerelease, once the lint and the fast VM tier have
# passed. The release notes are the commit messages since the previous version tag, by kokai.
publish:
needs: [lint, vm-fast, build]
if: >-
github.repository == 'LGUG2Z/komorebi-for-kde' && (startsWith(github.ref, 'refs/tags/v') ||
(github.ref == 'refs/heads/master' &&
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')))
runs-on: ubuntu-24.04
permissions:
contents: write
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Decide what is published
run: |
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
echo "TAG=$GITHUB_REF_NAME" >>"$GITHUB_ENV"
echo "VERSION=${GITHUB_REF_NAME#v}" >>"$GITHUB_ENV"
else
echo "TAG=nightly" >>"$GITHUB_ENV"
echo "VERSION=nightly" >>"$GITHUB_ENV"
fi
- uses: actions/download-artifact@v8
with:
pattern: komorebi-*-${{ github.sha }}
path: artifacts
- name: Package
run: |
mkdir dist
for target in x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu; do
build="artifacts/komorebi-$target-$GITHUB_SHA"
if [ ! -d "$build" ]; then
echo "::warning::there is no build for $target, so it is not published"
continue
fi
# an artifact does not keep the executable bit
chmod +x "$build/komorebi" "$build/komorebic"
zip -j "dist/komorebi-$VERSION-$target.zip" "$build/komorebi" "$build/komorebic"
done
- name: Add the schema of komorebi.json
if: hashFiles('schema.json') != ''
run: cp schema.json dist/
- name: Write the checksums
working-directory: dist
run: sha256sum -- * >checksums.txt
- name: Write the release notes
run: |
cargo install --locked kokai@0.3.1
# kokai lists the commits between the tag before the one it is given and that one. The
# nightly tag of the last run moves to this commit, so that the range starts at the
# last version.
if [ "$TAG" = nightly ]; then git tag --force nightly; fi
kokai release --no-emoji --add-links github:commits,issues --ref "$TAG" \
>"$RUNNER_TEMP/release-notes.md"
- name: Publish
run: |
if [ "$TAG" = nightly ]; then
gh release delete nightly --cleanup-tag --yes || true
gh release create nightly --target "$GITHUB_SHA" --prerelease \
--title "komorebi for KDE nightly ($GITHUB_SHA)" \
--notes-file "$RUNNER_TEMP/release-notes.md" dist/*
else
gh release create "$TAG" --verify-tag --title "komorebi for KDE $TAG" \
--notes-file "$RUNNER_TEMP/release-notes.md" dist/*
fi
+29
View File
@@ -173,6 +173,35 @@ run `nix flake update nixpkgs` in a checkout and build the check the issue
names (`just vm NAME` for a VM suite). The fix goes in a commit of its own;
nixpkgs is not pinned back.
## Releases
A release is a tag. Set `version` under `[workspace.package]` in
[`Cargo.toml`](Cargo.toml) to the new version, commit it, and push the tag
`vVERSION` on that commit. For every run, the `build` job of `ci.yaml` builds
`komorebi` and `komorebic` with nix on an x86_64 and an arm64 runner, and keeps
them as an artifact of the run for 14 days. On a tag, once `lint`, `vm-fast` and
`build` have passed, the `publish` job makes the GitHub release of that tag
with:
- `komorebi-VERSION-x86_64-unknown-linux-gnu.zip` and
`komorebi-VERSION-aarch64-unknown-linux-gnu.zip`, each with the two binaries;
- `checksums.txt`, the SHA-256 sum of every other file of the release;
- `schema.json`, the schema of `komorebi.json`, when the repository has one;
- release notes that [kokai](https://github.com/Joxit/kokai) writes from the
commit messages since the previous version tag.
The scheduled run on `master` every week, and a run of the workflow started by
hand on `master`, replace the `nightly` prerelease the same way: `nightly`
takes the place of the version in the file names, and the notes list the
commits since the last version tag. The arm64 job may fail without failing the
run; the release then has no arm64 zip.
nix builds a binary that loads glibc from the nix store, so the build job
points each binary at the system's dynamic loader, at the standard path for its
architecture, with no library path, and runs it on the Ubuntu runner to check
that it starts. A release binary therefore uses the glibc of the system it runs
on.
## Commits
Commit messages follow the
+21 -3
View File
@@ -11,9 +11,10 @@ moving and the drawing.
On NixOS, the flake's module, `services.komorebi`, installs `komorebi` and
`komorebic` and starts komorebi with every Plasma session: one flake input,
one module line and `services.komorebi.enable = true`. Elsewhere, both are
built from source. [`docs/installation.md`](docs/installation.md) has both
ways. There are no prebuilt binaries: the Komorebi license does not allow third
parties to redistribute them.
built from source, or taken from a release of this repository
([Binaries](#binaries)). [`docs/installation.md`](docs/installation.md) has the
module and the build from source. The Komorebi license does not allow anyone
else to redistribute binaries.
## Running it locally
@@ -62,6 +63,23 @@ use. With [direnv](https://direnv.net), the [`.envrc`](.envrc) does it on
`cd`. On Linux, `nix run .#komorebi -- --version` builds and runs the daemon
without a checkout of the toolchain.
## Binaries
The [releases](https://github.com/LGUG2Z/komorebi-for-kde/releases) of this
repository have `komorebi` and `komorebic` for x86_64 and aarch64 Linux, one zip
per architecture, with a `checksums.txt` of SHA-256 sums. The `nightly`
prerelease is built from `master` every week. CI builds the binaries;
[`CONTRIBUTING.md`](CONTRIBUTING.md#releases) says how. They use the glibc of
the system they run on, which has to be 2.39 or newer at time of writing
(2026-10-27). NixOS cannot run them without
[nix-ld](https://github.com/nix-community/nix-ld); on NixOS, build komorebi
from this flake instead.
The [Komorebi License](LICENSE.md) allows anyone to distribute the source code,
but not binaries built from it. The releases of this repository are the only
binaries, and there is no public binary cache for the flake: nix builds
komorebi from source.
## Crates
- [`komorebi`](komorebi): the daemon, and the library behind it. The library has
+14 -1
View File
@@ -203,7 +203,9 @@ again.
## Why is there no binary cache?
The Komorebi license does not allow third parties to redistribute binaries. There is no public
binary cache for komorebi, and every installation builds it from source.
binary cache for komorebi, so the flake builds it from source on each machine that installs it.
The releases of this repository are the only binaries
([why](#why-are-binaries-published-only-by-this-repository)).
## Why do the VM tests run on machines built with the module?
@@ -829,3 +831,14 @@ builders: those boot a virtual machine as part of the build, so they need a buil
a Linux builder that is itself a virtual machine on the Mac, as `darwin.linux-builder` is, has no
nested KVM. `nixos-install` is a plain program, in a guest that runs at the speed of the Mac's own
virtualization.
## Why are binaries published only by this repository?
The Komorebi License allows anyone to distribute the source code, with changes, but not
binaries built from it. So the releases of this repository, which CI builds, are the only
binaries, and the flake has no public binary cache: nix builds komorebi from source.
The release binaries are built by nix like every other output of the flake, then pointed at
the system's dynamic loader with no library path. As nix builds it, a binary loads glibc from
the store paths of the nixpkgs revision it was built with, which a machine without that
revision in its store does not have.
+6 -4
View File
@@ -5,11 +5,13 @@ command line that controls it. The daemon runs in a KDE Plasma Wayland session w
newer ([PLATFORM.md](dev/PLATFORM.md) has what it needs from the session).
On NixOS, the repository's flake has a module that installs both programs and starts komorebi
with every Plasma session. On any other distribution, build them from source.
with every Plasma session. On any other distribution, build them from source, or take the
binaries of a release ([Binaries](../README.md#binaries) says which and what they need).
There is no binary cache and there are no prebuilt binaries: the Komorebi license does not allow
third parties to redistribute binaries, so every installation builds komorebi from source. On
NixOS, Nix does that for you, the first time you switch to a configuration that has it.
There is no binary cache: the Komorebi license does not allow third parties to redistribute
binaries, so the flake builds komorebi from source on each machine that installs it. On NixOS,
Nix does that for you, the first time you switch to a configuration that has it. The releases of
this repository are the only binaries.
## NixOS