lib/Makefile

36 lines
1.4 KiB
Makefile
Raw Permalink Normal View History

2021-07-31 03:05:02 +00:00
feat: replace manual release ritual with `make release` (ADR-KV-014) The README's "Update Procedure" required three web UIs (GitHub branch defaults, GitHub releases, Gitea "Synchronize Now") and a go-swagger CLI installed nowhere. Now that lib is main+tags instead of branch-per-version, replace it with scripts/release.sh driven through the Makefile: - `make install-swagger` installs a pinned go-swagger (v0.35.0) and verifies the version. - `make regen` copies the sibling service specs and regenerates api/ clients exactly as the old `make swagger` ritual did, failing fast if a sibling spec is missing. Regen output is reviewed/committed as its own PR, same as any other change. - `make release VERSION=vX.Y.Z` / `make release-dry-run VERSION=vX.Y.Z` validate semver + monotonicity, require a clean main checkout synced with origin/main, tag, push, `gh release create`, and POST to the Gitea mirror-sync API for the vernonkeenan/lib and work/lib mirrors (skipped with a loud warning if GITEA_TOKEN is unset). Also scope the CI push trigger to `main` + `v*` tags instead of every branch, so PRs (which already run via the `pull_request` trigger) stop double-running. Verified locally: bash -n + shellcheck clean; install-swagger into a temp GOBIN across go-swagger v0.33.2-v0.35.0; semver/monotonicity/ tag-exists/branch/origin-sync validation failure paths; a full regen against the real sibling specs in a scratch dir (never the checked-out api/swagger). That regen surfaced a real go-swagger limitation -- documented in the README and as a warning in the script -- reproduced across all four installable versions: an untagged operation in sf-gate-vernonkeenan.yaml produces a client that doesn't compile. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 06:49:23 +00:00
# Pinned go-swagger version for `make install-swagger` / `make regen`.
# Bump deliberately, verify `swagger version` matches, and record the change
# here and in README.md's Release Procedure. Chosen 2026-07-12: latest
# stable go-swagger release at the time (ADR-KV-014).
SWAGGER_VERSION := v0.35.0
export SWAGGER_VERSION
2021-07-31 03:05:02 +00:00
feat: replace manual release ritual with `make release` (ADR-KV-014) The README's "Update Procedure" required three web UIs (GitHub branch defaults, GitHub releases, Gitea "Synchronize Now") and a go-swagger CLI installed nowhere. Now that lib is main+tags instead of branch-per-version, replace it with scripts/release.sh driven through the Makefile: - `make install-swagger` installs a pinned go-swagger (v0.35.0) and verifies the version. - `make regen` copies the sibling service specs and regenerates api/ clients exactly as the old `make swagger` ritual did, failing fast if a sibling spec is missing. Regen output is reviewed/committed as its own PR, same as any other change. - `make release VERSION=vX.Y.Z` / `make release-dry-run VERSION=vX.Y.Z` validate semver + monotonicity, require a clean main checkout synced with origin/main, tag, push, `gh release create`, and POST to the Gitea mirror-sync API for the vernonkeenan/lib and work/lib mirrors (skipped with a loud warning if GITEA_TOKEN is unset). Also scope the CI push trigger to `main` + `v*` tags instead of every branch, so PRs (which already run via the `pull_request` trigger) stop double-running. Verified locally: bash -n + shellcheck clean; install-swagger into a temp GOBIN across go-swagger v0.33.2-v0.35.0; semver/monotonicity/ tag-exists/branch/origin-sync validation failure paths; a full regen against the real sibling specs in a scratch dir (never the checked-out api/swagger). That regen surfaced a real go-swagger limitation -- documented in the README and as a warning in the script -- reproduced across all four installable versions: an untagged operation in sf-gate-vernonkeenan.yaml produces a client that doesn't compile. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 06:49:23 +00:00
.PHONY: install-swagger regen release release-dry-run swagger
# Install the pinned go-swagger CLI and verify its version.
install-swagger:
./scripts/release.sh install-swagger
# Regenerate api/ clients from the sibling service specs (../{auth,crm,stash,
# sf-gate,research,members,plex}/swagger/*.yaml). Requires the sibling repos
# to be cloned adjacently (same prerequisite the old README ritual had).
# Review and commit the result as its own PR before `make release`.
regen: install-swagger
./scripts/release.sh regen
# Cut a release: tag HEAD of main, push the tag, publish the GitHub release,
# and trigger the Gitea mirror-sync. Requires a clean main checkout that
# matches origin/main. Usage: make release VERSION=v0.7.5
release:
./scripts/release.sh release "$(VERSION)"
# Same as `release` but stops before tag/push/release/mirror-sync — prints
# what would happen. Usage: make release-dry-run VERSION=v0.7.5
release-dry-run:
./scripts/release.sh release "$(VERSION)" --dry-run
# Deprecated alias for `regen`, kept because old muscle memory (and the
# README ritual) called this `make swagger`.
swagger: regen