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
+74
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# The automatic half of the leak standard, run on what a public release would
|
||||
# publish: the exported tree and the public changelog. Two kinds of hit fail it:
|
||||
#
|
||||
# words that must never ship the names of tools and services this project
|
||||
# has nothing to do with in public
|
||||
# private record ids "#1234", "rule 12", "milestone 7": pointers into
|
||||
# a tracker no reader of the release can open
|
||||
#
|
||||
# The ids are also searched with comment continuation lines joined, because a
|
||||
# citation split at a line break ("see rule\n// 12") passes a per-line search.
|
||||
#
|
||||
# The by-eye half (people, titles, quotes, images) is not here: a search cannot
|
||||
# decide it.
|
||||
#
|
||||
# Known false positives are listed in leak-allow.txt, one pattern per line. A
|
||||
# pattern is cut out of a hit line before the line is tested again, so an
|
||||
# allowed word never hides a real hit beside it.
|
||||
#
|
||||
# Usage: ci/leakgate.sh <path>... (directories are searched recursively)
|
||||
# Prints each hit and exits 1 if there is one.
|
||||
set -euo pipefail
|
||||
|
||||
readonly HARD='sluice|storehouse|prospector|bookbag|musicbox|fabledexchange|lidarr|readarr|chaptarr|prowlarr|jackett|sonarr|radarr|qbittorrent|deluge|sabnzbd|nzbget|slskd|soulseek|deemix|torrent|usenet|\bnzb\b|magnet:|grimoire|\bscribe\b|traefik\.internal|vdnt'
|
||||
readonly IDS='(\(|\s)#[0-9]{3,5}\b|\bM[0-9]{1,3}\b|\b(rule|preference|lesson|snippet|process|milestone) #?[0-9]{1,5}\b'
|
||||
# Joined across comment lines, only the worded citations: the bare forms above
|
||||
# are already whole on one line.
|
||||
readonly JOINED='\b(?:rule|preference|lesson|snippet|process|milestone|task|issue)\s+#?\d{1,5}\b|\b(?:reference|measured)\s+library\b'
|
||||
|
||||
[ "$#" -gt 0 ] || { echo "usage: $0 <path>..." >&2; exit 2; }
|
||||
|
||||
here="$(cd "$(dirname "$0")" && pwd)"
|
||||
strip="$(mktemp)"
|
||||
trap 'rm -f "$strip"' EXIT
|
||||
# One sed substitution per allowed pattern, case-insensitive like the search.
|
||||
# \x01 delimits, so a pattern may hold any other character.
|
||||
while IFS= read -r pattern; do
|
||||
case "$pattern" in '' | '#'*) continue ;; esac
|
||||
printf 's\x01%s\x01\x01gI\n' "$pattern" >>"$strip"
|
||||
done <"$here/leak-allow.txt"
|
||||
|
||||
# Reads grep's path:line:text and prints the hits that still match once the
|
||||
# allowed patterns are cut out of the text.
|
||||
still() {
|
||||
local hit text
|
||||
while IFS= read -r hit; do
|
||||
text="${hit#*:*:}"
|
||||
if printf '%s\n' "$text" | sed -E -f "$strip" | grep -qiE -- "$1"; then
|
||||
printf '%s\n' "$hit"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
found="$(
|
||||
{
|
||||
grep -rnHIiE -- "$HARD" "$@" || true
|
||||
grep -rnHIiE -- "$IDS" "$@" || true
|
||||
} | still "$HARD|$IDS"
|
||||
# -I skips binary files, as grep does above. Each joined hit is printed as
|
||||
# path:joined:text, so the same filter applies.
|
||||
find "$@" -type f -exec grep -lIZ '' {} + 2>/dev/null \
|
||||
| xargs -0 -r perl -0777 -ne '
|
||||
s/\n[ \t]*(?:\/\/+|--|\*|#+)[ \t]*/ /g;
|
||||
while (/('"$JOINED"')/gi) { (my $m = $1) =~ s/\s+/ /g; print "$ARGV:joined:$m\n" }' \
|
||||
| still "$(printf '%s' "$JOINED" | sed -E 's/\(\?:/(/g; s/\\s/[[:space:]]/g; s/\\d/[0-9]/g')"
|
||||
)"
|
||||
|
||||
if [ -n "$found" ]; then
|
||||
printf '%s\n' "$found" | sort -u
|
||||
echo "leakgate: the hits above would be published; reword them, or list a false positive in ci/leak-allow.txt" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "leakgate: clean"
|
||||
Reference in New Issue
Block a user