breadhelp/.forgejo/workflows/package.yml
Breadway 292172909a
Some checks failed
Build and publish package / package (push) Failing after 1m49s
CI: install gtk4-layer-shell before makepkg dependency check
makepkg without -s doesn't auto-resolve deps; the pacman -Syu step must
list every runtime dep the PKGBUILD declares. gtk4/glib2 happened to
already be listed for a different reason (build toolchain), but
gtk4-layer-shell and hicolor-icon-theme were missing, failing the v0.2.0
CI run before it ever built anything.
2026-07-15 19:08:21 +08:00

40 lines
1.8 KiB
YAML

name: Build and publish package
on:
push:
tags: ['v*']
jobs:
package:
runs-on: [self-hosted, hestia]
container:
image: archlinux:latest
steps:
# Note: no actions/checkout — the archlinux image has no Node, which JS
# actions require. Everything runs as shell steps and clones manually.
- name: Build and publish
env:
PUBLISH_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
set -euo pipefail
VERSION="${GITHUB_REF_NAME#v}"
pacman -Syu --noconfirm base-devel git rust cargo gtk4 glib2 gtk4-layer-shell hicolor-icon-theme
useradd -m builder
git config --global --add safe.directory '*'
git clone --branch "${GITHUB_REF_NAME}" --depth 1 \
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" /home/builder/src
cd /home/builder/src
git archive --format=tar.gz --prefix="breadhelp-${VERSION}/" HEAD \
> packaging/breadhelp-${VERSION}.tar.gz
SHA=$(sha256sum packaging/breadhelp-${VERSION}.tar.gz | awk '{print $1}')
sed -i "s/^pkgver=.*/pkgver=${VERSION}/" packaging/PKGBUILD
sed -i "s/^sha256sums=.*/sha256sums=('${SHA}')/" packaging/PKGBUILD
chown -R builder:builder /home/builder/src
# --nocheck: packaging builds the artifact; tests belong in a CI job.
su builder -c "cd /home/builder/src/packaging && makepkg -f --noconfirm --nocheck"
PKG=$(find /home/builder/src/packaging -name '*.pkg.tar.zst' | head -1)
curl -fsS -X PUT \
-H "Authorization: token ${PUBLISH_TOKEN}" \
-H "Content-Type: application/octet-stream" \
--data-binary "@${PKG}" \
"https://git.breadway.dev/api/packages/Breadway/arch/os"