Skip to content

Tighten README and landing copy; add PSI baseline report (#36) #36

Tighten README and landing copy; add PSI baseline report (#36)

Tighten README and landing copy; add PSI baseline report (#36) #36

Workflow file for this run

name: auto-release
# Every merge to main cuts a patch release automatically: bump the latest v*
# tag (scripts/next-version.sh), tag the merge commit, and create the GitHub
# Release with notes from the PRs merged since the last tag. The first run with
# no tags yet seeds v0.1.0. This does NOT deploy — the deploy workflow stays
# on push-to-main and bakes the same version into the live label.
#
# For a minor/major bump, run `just release minor|major` by hand (its
# user-pushed tag fires release.yml, the manual path). To skip a release for a
# trivial merge, put [skip release] in the PR title (the squash subject) — the
# check reads only the subject line, so mentioning it in a PR/commit body (as
# this very comment does) does not trip it. Docs-only merges (only Markdown,
# docs/, or image assets changed) skip the release automatically — no marker
# needed.
on:
push:
branches: [main]
# Tag the commit + create the Release.
permissions:
contents: write
# Serialize so two quick merges can't race to claim the same next tag.
concurrency: auto-release
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- name: Tag + release
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
# Subject line only (%s) — matching the whole message (%B) would let
# a PR/commit body that merely mentions the marker skip the release.
if git log -1 --pretty=%s | grep -qiE '\[skip[ -]release\]'; then
echo "[skip release] in the commit subject — no release cut."
exit 0
fi
# Docs-only merges never cut a release, even without the marker: if
# every file this merge changed is documentation (Markdown, docs/, or
# an image asset), there's no app change to version. Count comparison
# (not grep -qv) to stay portable across BSD/GNU grep.
changed="$(git diff --name-only HEAD^ HEAD)"
if [ -n "$changed" ]; then
total=$(printf '%s\n' "$changed" | wc -l | tr -d ' ')
docs=$(printf '%s\n' "$changed" | grep -Ec '(\.md$|^docs/|\.(gif|png|jpe?g|webp|svg)$)' || true)
if [ "$total" = "$docs" ]; then
echo "Docs-only merge — no release cut. Changed files:"
printf '%s\n' "$changed"
exit 0
fi
fi
# Idempotent: if this commit is already tagged (re-run, or a manual
# release just landed), there's nothing to cut.
if existing=$(git describe --tags --exact-match HEAD 2>/dev/null); then
echo "HEAD is already released as $existing — nothing to do."
exit 0
fi
next="$(scripts/next-version.sh patch)"
echo "Releasing $next ($(git rev-parse --short HEAD))"
# The runner has no git identity; annotated tags need one.
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -a "$next" -m "Release $next"
# Pushed with GITHUB_TOKEN, so this tag does NOT trigger release.yml
# (that's the manual path) — we cut the Release in-job below instead.
git push origin "$next"
gh release create "$next" --verify-tag --generate-notes