Files
gtk-ahfail/.gitea/workflows/release.yml
T
Asger Geel Weirsøe 8b777652be Move the Homebrew formula to the tap on GitHub
Homebrew could not clone the Gitea tap (git over HTTP is disabled), so
brew tap agw/ahfail never worked. The formula now lives in
asger-weirsoee/homebrew-tap, and releases update it with a deploy key.

Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG
2026-09-30 21:59:58 +02:00

75 lines
3.0 KiB
YAML

name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
# Built on Arch: the locker needs gtk-session-lock (not packaged by Ubuntu).
container:
image: archlinux:base-devel
steps:
- name: Install system dependencies
run: pacman -Syu --noconfirm --needed base-devel git openssh nodejs rust meson ninja gtk3 gtk-session-lock gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad-libs pam curl python
- uses: actions/checkout@v4
- name: Compute source tarball SHA256
run: |
SHA256=$(curl -fsSL \
"https://gitea.weircon.dk/agw/gtk-ahfail/archive/${{ github.ref_name }}.tar.gz" \
| sha256sum | cut -d' ' -f1)
echo "SOURCE_SHA256=${SHA256}" >> $GITHUB_ENV
- name: Build release
run: |
meson setup builddir --buildtype=release
meson compile -C builddir
- name: Bundle artifacts
run: |
mkdir -p dist
cp builddir/ahfail-module.so dist/
cp builddir/libahfail_pam.so dist/
cp builddir/ahfail-display dist/
cp builddir/ahfail dist/
cp data/pam.d/ahfail dist/ahfail.pam
tar czf ahfail-linux-x86_64.tar.gz -C dist .
- name: Upload release asset
# RELEASE_TOKEN: an agw token with write:repository scope. Gitea refuses
# secret names that start with GITEA_ or GITHUB_, so it cannot be called
# GITEA_TOKEN.
uses: https://gitea.com/actions/gitea-release-action@v1
with:
token: ${{ secrets.RELEASE_TOKEN }}
server_url: ${{ github.server_url }}
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
files: ahfail-linux-x86_64.tar.gz
- name: Update Homebrew tap
# The tap lives on GitHub (asger-weirsoee/homebrew-tap): Homebrew cannot
# clone from this Gitea, where git over HTTP is disabled. The deploy key
# can write only to that one repository; the tap's Actions then build
# and test the formula on a real Mac.
env:
HOMEBREW_TAP_DEPLOY_KEY: ${{ secrets.HOMEBREW_TAP_DEPLOY_KEY }}
TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
mkdir -p ~/.ssh
printf '%s\n' "$HOMEBREW_TAP_DEPLOY_KEY" > ~/.ssh/tap
chmod 600 ~/.ssh/tap
export GIT_SSH_COMMAND="ssh -i ~/.ssh/tap -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new"
git clone -q git@github.com:asger-weirsoee/homebrew-tap.git tap
cd tap
URL="https://gitea.weircon.dk/agw/gtk-ahfail/archive/${TAG}.tar.gz"
sed -i "s|^ url \".*\"| url \"$URL\"|; s|^ sha256 \".*\"| sha256 \"${SOURCE_SHA256}\"|" Formula/ahfail.rb
if git diff --quiet; then echo "formula already up to date"; exit 0; fi
git -c user.name="Asger Geel Weirsøe" -c user.email="github@weircon.dk" commit -q -am "ahfail ${TAG#v}"
git push -q origin HEAD