2026-09-01 23:20:04 +02:00
|
|
|
name: package
|
|
|
|
|
|
2026-09-01 23:31:27 +02:00
|
|
|
# Builds the imsd apk(s) for aarch64 from the pushed commit and publishes
|
|
|
|
|
# them to the Forgejo Alpine registry — the repo installed phones already
|
|
|
|
|
# point at (via catcrafts-fp6-repo), so a release reaches users through
|
|
|
|
|
# plain 'apk upgrade' without an fp6-img image run.
|
2026-09-01 23:20:04 +02:00
|
|
|
#
|
2026-09-01 23:31:27 +02:00
|
|
|
# Build: crafter-build cross-compiles against an Alpine aarch64 sysroot
|
project, docs: the linter goes
The Catcrafts house-style rules (Crafter.LintRules) rode in project.cpp
as a dependency crafter-build cloned once and built on every load; the tree
never passed them (111 findings on the 1.1.0 tree, 156 on an early freeze
of this range (2e87e26), 100 of the 156 the shared naming rule's, each
for a variable whose name begins with a capital — the
fp6 journal's lint captures, lint-tip-2e87e26), CI never ran them,
and AGENTS.md kept a census nobody acted on. Out: the dependency, the
import and the five AddRules calls, the lint-disable comments in 25
files and on 4 lines, §4.2 and the census of §6 — now "Code style", the
three rules that were never the linter's; the cross-compiling section
becomes §4.2 and its six citations — §4.1's sysroot sentence, §9.1, the CI
workflow, the APKBUILD, build-package.sh, make-sysroot.sh — follow. Jorijn, 2026-10-17: "just
remove the linter, we are ignoring it anyway".
2026-10-18 00:05:06 +02:00
|
|
|
# (packaging/build-package.sh — AGENTS.md §4.2's cross-compiling flow), the
|
2026-09-01 23:31:27 +02:00
|
|
|
# test suite runs natively, and packaging/APKBUILD.binary wraps the result.
|
packaging, ci: build the apks with the Crafter.Build Flatpak
Crafter.Build's CI publishes a Flatpak and nothing else since
2026-10-02: the rolling `latest` release's
`crafter-build-linux-x86_64-musl-v2.tar.gz` that build-package.sh
fetched is gone (404 since 2026-10-03), so a push of a release would
fail at `fetch crafter-build` and publish nothing.
Install the Flatpak (`net.catcrafts.CrafterBuild//stable` from
flatpak.catcrafts.net) in the job container and run it as crafter-build.
bubblewrap inside the container needs a privileged runner, so the job
runs on the `flatpak` label. The sysroot stays Alpine edge and gains
llvm-runtimes, the package with the std module source of its own libc++
(libc++-dev ships none). make-sysroot.sh adds its list with --upgrade:
run over a sysroot from before this change (libc++ 22.1.8, no std module
source) a plain add installed llvm-runtimes 23.1.2 alone, and its
std.cppm did not compile against the 22.1.8 headers (`'text_encoding'
file not found`); with --upgrade libc++, libc++-dev and llvm-runtimes
came out at 23.1.2 and it compiled.
AGENTS.md §4.1, §4.3, §8.3 and §9.4 describe the route as it runs, and
the README's Building section carries the install lines. Three comments
in the files this touches said what is not so and are corrected:
package.yml had fp6-img install the package by a pinned version and
sha256 (it takes the newest in the registry), build-package.sh had
fp6-img's image build run `make check` on the aarch64 binaries (it
builds no imsd: no suite runs on them), and make-sysroot.sh's usage line
lacked the --march without which the cross build fails on an x86 host.
Tested: build-package.sh run end to end on this commit in a privileged
alpine:edge container (podman) on the workstation.
2026-10-04 01:23:23 +02:00
|
|
|
# crafter-build is the Crafter.Build Flatpak, and bubblewrap inside the job
|
|
|
|
|
# container needs a privileged runner: the job runs on the `flatpak` label
|
|
|
|
|
# (a privileged runner registered to this repository), in an alpine:edge
|
|
|
|
|
# container.
|
2026-09-01 23:20:04 +02:00
|
|
|
#
|
2026-09-01 23:31:27 +02:00
|
|
|
# Release gating is the version: pkgver comes from implementations/main.cpp,
|
|
|
|
|
# the registry answers 409 for an already-published version, and the publish
|
|
|
|
|
# step treats that as "nothing to do" — so pushes only release when the
|
2026-09-02 16:08:21 +02:00
|
|
|
# Version constant bumps. This is the only producer of the imsd apk: fp6-img
|
packaging, ci: build the apks with the Crafter.Build Flatpak
Crafter.Build's CI publishes a Flatpak and nothing else since
2026-10-02: the rolling `latest` release's
`crafter-build-linux-x86_64-musl-v2.tar.gz` that build-package.sh
fetched is gone (404 since 2026-10-03), so a push of a release would
fail at `fetch crafter-build` and publish nothing.
Install the Flatpak (`net.catcrafts.CrafterBuild//stable` from
flatpak.catcrafts.net) in the job container and run it as crafter-build.
bubblewrap inside the container needs a privileged runner, so the job
runs on the `flatpak` label. The sysroot stays Alpine edge and gains
llvm-runtimes, the package with the std module source of its own libc++
(libc++-dev ships none). make-sysroot.sh adds its list with --upgrade:
run over a sysroot from before this change (libc++ 22.1.8, no std module
source) a plain add installed llvm-runtimes 23.1.2 alone, and its
std.cppm did not compile against the 22.1.8 headers (`'text_encoding'
file not found`); with --upgrade libc++, libc++-dev and llvm-runtimes
came out at 23.1.2 and it compiled.
AGENTS.md §4.1, §4.3, §8.3 and §9.4 describe the route as it runs, and
the README's Building section carries the install lines. Three comments
in the files this touches said what is not so and are corrected:
package.yml had fp6-img install the package by a pinned version and
sha256 (it takes the newest in the registry), build-package.sh had
fp6-img's image build run `make check` on the aarch64 binaries (it
builds no imsd: no suite runs on them), and make-sysroot.sh's usage line
lacked the --march without which the cross build fails on an x86 host.
Tested: build-package.sh run end to end on this commit in a privileged
alpine:edge container (podman) on the workstation.
2026-10-04 01:23:23 +02:00
|
|
|
# images install the published package from the registry instead of
|
|
|
|
|
# building their own, so image and 'apk upgrade' carry the same binary.
|
2026-09-01 23:31:27 +02:00
|
|
|
#
|
2026-09-02 00:39:40 +02:00
|
|
|
# Publishing needs PACKAGE_TOKEN (catbot account, package:write scope) — an
|
|
|
|
|
# org-level secret on Catcrafts since 2026-09-02, shared with fp6-img;
|
|
|
|
|
# without it the build still runs and the publish step skips quietly.
|
2026-09-01 23:20:04 +02:00
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
push:
|
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
package:
|
packaging, ci: build the apks with the Crafter.Build Flatpak
Crafter.Build's CI publishes a Flatpak and nothing else since
2026-10-02: the rolling `latest` release's
`crafter-build-linux-x86_64-musl-v2.tar.gz` that build-package.sh
fetched is gone (404 since 2026-10-03), so a push of a release would
fail at `fetch crafter-build` and publish nothing.
Install the Flatpak (`net.catcrafts.CrafterBuild//stable` from
flatpak.catcrafts.net) in the job container and run it as crafter-build.
bubblewrap inside the container needs a privileged runner, so the job
runs on the `flatpak` label. The sysroot stays Alpine edge and gains
llvm-runtimes, the package with the std module source of its own libc++
(libc++-dev ships none). make-sysroot.sh adds its list with --upgrade:
run over a sysroot from before this change (libc++ 22.1.8, no std module
source) a plain add installed llvm-runtimes 23.1.2 alone, and its
std.cppm did not compile against the 22.1.8 headers (`'text_encoding'
file not found`); with --upgrade libc++, libc++-dev and llvm-runtimes
came out at 23.1.2 and it compiled.
AGENTS.md §4.1, §4.3, §8.3 and §9.4 describe the route as it runs, and
the README's Building section carries the install lines. Three comments
in the files this touches said what is not so and are corrected:
package.yml had fp6-img install the package by a pinned version and
sha256 (it takes the newest in the registry), build-package.sh had
fp6-img's image build run `make check` on the aarch64 binaries (it
builds no imsd: no suite runs on them), and make-sysroot.sh's usage line
lacked the --march without which the cross build fails on an x86 host.
Tested: build-package.sh run end to end on this commit in a privileged
alpine:edge container (podman) on the workstation.
2026-10-04 01:23:23 +02:00
|
|
|
runs-on: flatpak
|
2026-09-01 23:31:27 +02:00
|
|
|
container:
|
|
|
|
|
image: alpine:edge
|
|
|
|
|
timeout-minutes: 90
|
2026-09-01 23:20:04 +02:00
|
|
|
steps:
|
|
|
|
|
# actions/checkout is a Node action; bare alpine has no node
|
|
|
|
|
- name: Provision job container
|
|
|
|
|
run: apk add -q nodejs git curl
|
|
|
|
|
|
|
|
|
|
- name: Checkout
|
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
2026-09-01 23:31:27 +02:00
|
|
|
- name: Build and package
|
2026-09-01 23:20:04 +02:00
|
|
|
run: ./packaging/build-package.sh
|
|
|
|
|
|
|
|
|
|
- name: Publish to the apk registry
|
|
|
|
|
env:
|
|
|
|
|
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
|
|
|
|
|
run: |
|
|
|
|
|
if [ -z "$PACKAGE_TOKEN" ]; then
|
|
|
|
|
echo "no PACKAGE_TOKEN secret configured; skipping package publish"
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
found=0
|
2026-09-01 23:31:27 +02:00
|
|
|
for f in /home/build/.local/share/abuild/*/aarch64/imsd*.apk; do
|
2026-09-01 23:20:04 +02:00
|
|
|
[ -e "$f" ] || continue
|
|
|
|
|
found=1
|
|
|
|
|
code=$(curl -s -o /dev/null -w '%{http_code}' \
|
|
|
|
|
--user "catbot:$PACKAGE_TOKEN" --upload-file "$f" \
|
|
|
|
|
"https://forgejo.catcrafts.net/api/packages/Catcrafts/alpine/edge/fp6")
|
|
|
|
|
case "$code" in
|
|
|
|
|
201) echo "published: $(basename "$f")" ;;
|
|
|
|
|
409) echo "already published: $(basename "$f")" ;;
|
|
|
|
|
*) echo "FAILED ($code): $(basename "$f")"; exit 1 ;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
[ "$found" = 1 ] || { echo "no packages found to publish"; exit 1; }
|