ci: add release automation and version check workflows
All checks were successful
CI / build (push) Successful in 21s
Endpoint Sync Check / check-drift (push) Successful in 31s

- release.yaml: auto-creates Gitea releases on semver tag push with
  changelog, version/tag consistency check, and endpoint drift check
- version-check.yaml: warns on PRs that change src/ without bumping
  the package.json version

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-16 00:27:07 -04:00
parent 54905bd7bb
commit 91c0aa707b
2 changed files with 121 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
name: Version Check
on:
pull_request:
branches: [main]
paths:
- 'package.json'
- 'src/**'
jobs:
check-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check version was bumped if source changed
run: |
BASE_SHA="${{ github.event.pull_request.base.sha }}"
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
# Check if any src/ files changed
SRC_CHANGED=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" -- 'src/' | wc -l)
if [ "$SRC_CHANGED" -eq 0 ]; then
echo "No source changes detected, skipping version check."
exit 0
fi
# Compare package.json versions
BASE_VERSION=$(git show "${BASE_SHA}:package.json" | node -p "JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')).version")
HEAD_VERSION=$(node -p "require('./package.json').version")
if [ "$BASE_VERSION" = "$HEAD_VERSION" ]; then
echo "::warning::Source files changed but package.json version was not bumped (${HEAD_VERSION}). Consider updating the version."
else
echo "Version bumped: ${BASE_VERSION} → ${HEAD_VERSION}"
fi