# ───────────────────────────────────────────────────────────────────────────── # Release — Create GitHub release from CHANGELOG, trigger Docker builds # Runs on pushes to the release branch when version changes. # ───────────────────────────────────────────────────────────────────────────── name: Release on: push: branches: [release] concurrency: group: release-${{ github.ref }} cancel-in-progress: false jobs: # ── Create release and trigger downstream workflows ────────────────────── publish: runs-on: ubuntu-latest timeout-minutes: 10 permissions: contents: write actions: write steps: - uses: actions/checkout@v4 - name: Read version id: pkg run: | VERSION=$(python3 -c " import re, pathlib text = pathlib.Path('pyproject.toml').read_text() m = re.search(r'^version\s*=\s*\"([^\"]+)\"', text, re.M) print(m.group(1)) ") echo "version=$VERSION" >> $GITHUB_OUTPUT - name: Extract release notes from CHANGELOG run: | VER="${{ steps.pkg.outputs.version }}" awk "/^## \[${VER}\]/{found=1; next} /^## \[/{if(found) exit} found{print}" \ CHANGELOG.md > /tmp/release-notes.md - name: Publish GitHub release env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | if gh release view "v${{ steps.pkg.outputs.version }}" &>/dev/null; then echo "Release v${{ steps.pkg.outputs.version }} already exists — skipping creation" else gh release create "v${{ steps.pkg.outputs.version }}" \ --title "v${{ steps.pkg.outputs.version }}" \ --notes-file /tmp/release-notes.md fi