ci: a merge to main is the public release; every dev push dry-runs it (#8358)
release / web (push) Successful in 1m29s
release / go (push) Successful in 1m54s
release / govulncheck (push) Successful in 18s
release / integration (push) Successful in 2m44s
release / android (push) Successful in 2m9s
release / Build signed APK (push) Successful in 2m1s
release / Build + push container image (push) Failing after 4s
release / web (push) Successful in 1m29s
release / go (push) Successful in 1m54s
release / govulncheck (push) Successful in 18s
release / integration (push) Successful in 2m44s
release / android (push) Successful in 2m9s
release / Build signed APK (push) Successful in 2m1s
release / Build + push container image (push) Failing after 4s
Every push now builds its image from the git archive export, after the changelog and the leak gate have run on it, so a dev push is the public release's dry run. A push to main then also commits and tags the export on github.com/Fabled-Sword/minstrel as AmateurDungeoneer, publishes ghcr.io/fabled-sword/minstrel :<name> and :latest, and creates the release page on GitHub (public changelog) and on this forge (private changelog). The scripts are Librarian's (ci/changelog.sh, ci/leakgate.sh, ci/releases.mjs, with their tests), with Minstrel's false positives and a changelog that ignores the forge-only v* tags from before the public releases, so the first public release is the fixed note. The tag build, its APK attach and its verify job, and the manual GHCR dispatch are gone: phones get the app from the server image, and no release carries a file. The push trigger has no path filter, because the README, docs and tests ship in the public release too. The README's image tags now name what GHCR carries: :latest and :<version>. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Executable
+86
@@ -0,0 +1,86 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# A release's changelog, in the two versions a release publishes:
|
||||
#
|
||||
# private.md every commit subject since the previous release, as written
|
||||
# public.md the same list with record ids cut out ("(#1234)", "rule 12"),
|
||||
# and the commits that only touch CI or tests left out, since
|
||||
# neither ships
|
||||
#
|
||||
# The previous release is the newest public-release tag (v<name>, from
|
||||
# PUBLIC_SINCE on) that is not on the commit being released. With none, this is
|
||||
# the first public release, and both versions are a fixed note rather than the
|
||||
# whole history before it.
|
||||
#
|
||||
# PUBLIC_SINCE exists because this repository also holds older v* tags, from
|
||||
# releases made on this forge alone before the public ones began. Those are not
|
||||
# public releases, so a changelog never counts from them.
|
||||
#
|
||||
# A commit whose subject must not reach the public list (it names something
|
||||
# private) is left out by listing its full hash in changelog-skip.txt. The
|
||||
# subject itself is never rewritten: the history is not.
|
||||
#
|
||||
# Usage: ci/changelog.sh <out-dir> [<commit-ish>] (default HEAD; needs the
|
||||
# full history and tags, fetch-depth: 0)
|
||||
set -euo pipefail
|
||||
|
||||
readonly PUBLIC_SINCE='v2026.12.04'
|
||||
|
||||
out="${1:?usage: $0 <out-dir> [<commit-ish>]}"
|
||||
ref="${2:-HEAD}"
|
||||
here="$(cd "$(dirname "$0")" && pwd)"
|
||||
mkdir -p "$out"
|
||||
|
||||
head="$(git rev-parse "$ref^{commit}")"
|
||||
previous=""
|
||||
for tag in $(git tag -l 'v*' --sort=-v:refname); do
|
||||
# sort -V puts the older of the two first.
|
||||
if [ "$(printf '%s\n%s\n' "$PUBLIC_SINCE" "$tag" | sort -V | head -1)" != "$PUBLIC_SINCE" ]; then
|
||||
break
|
||||
fi
|
||||
if [ "$(git rev-parse "$tag^{commit}")" != "$head" ]; then
|
||||
previous="$tag"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$previous" ]; then
|
||||
note='The first public release of Fabled Minstrel, a self-hosted music server with its own Android app. The README says what it does and how to run it.'
|
||||
printf '%s\n' "$note" >"$out/private.md"
|
||||
printf '%s\n' "$note" >"$out/public.md"
|
||||
echo "changelog: first release, the fixed note"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
subjects="$(git log --no-merges --reverse --format='%H %s' "$previous..$head")"
|
||||
|
||||
{
|
||||
printf 'Changes since %s:\n\n' "$previous"
|
||||
printf '%s\n' "$subjects" | sed -E '/^$/d; s/^[0-9a-f]+ /- /'
|
||||
} >"$out/private.md"
|
||||
|
||||
skip="$(grep -oE '^[0-9a-f]{40}' "$here/changelog-skip.txt" || true)"
|
||||
{
|
||||
printf 'Changes since %s:\n\n' "$previous"
|
||||
printf '%s\n' "$subjects" | while IFS=' ' read -r hash subject; do
|
||||
[ -n "$hash" ] || continue
|
||||
if printf '%s\n' "$skip" | grep -qx "$hash"; then continue; fi
|
||||
# The area before the colon, as a list: "server, web, ci". A type with a
|
||||
# scope, "test(web)", counts by its type.
|
||||
area="${subject%%:*}"
|
||||
if [ "$area" != "$subject" ] &&
|
||||
! printf '%s\n' "$area" | sed -E 's/\(.*\)//' | tr ',' '\n' | sed -E 's/^ +| +$//g' |
|
||||
grep -qvxE 'ci|tests?|[a-z]+ tests?'; then
|
||||
continue
|
||||
fi
|
||||
printf -- '- %s\n' "$subject"
|
||||
done | sed -E '
|
||||
s/ *\(((rule|preference|lesson|snippet|process|milestone|task|issue) )?#?[0-9]+(, *#?[0-9]+)*\)//gI
|
||||
s/ *\b(rule|preference|lesson|snippet|process|milestone|task|issue) #?[0-9]+//gI
|
||||
s/ *#[0-9]{3,5}\b//g
|
||||
s/ *\( *\)//g
|
||||
s/ +([,;.])/\1/g
|
||||
s/[,;] *$//'
|
||||
} >"$out/public.md"
|
||||
|
||||
echo "changelog: $(grep -c '^- ' "$out/private.md" || true) commits since $previous, $(grep -c '^- ' "$out/public.md" || true) public"
|
||||
Reference in New Issue
Block a user