Skip to content

Auto-create GitHub Release on tag push#5

Merged
mstorath merged 1 commit into
masterfrom
claude/auto-github-release-2026-05
May 8, 2026
Merged

Auto-create GitHub Release on tag push#5
mstorath merged 1 commit into
masterfrom
claude/auto-github-release-2026-05

Conversation

@mstorath

@mstorath mstorath commented May 8, 2026

Copy link
Copy Markdown
Owner

Summary

When DCEBE first ships via a v* tag push, the workflow uploads to PyPI but does not create a GitHub Release entry. This PR closes that gap: the publish job in release.yml now also creates a Release.

DCEBE doesn't have a CHANGELOG.md yet (port is in progress). The extractor is defensive — it falls through to a tag-commits-link stub when no CHANGELOG is present, and generate_release_notes: true on the release action provides an auto-generated PR/commit summary as the visible body. When a curated CHANGELOG.md lands later, the same workflow starts using it without modification.

Identical pattern to:

How it works

In the existing publish job, after the PyPI upload:

  1. actions/checkout@v4 puts the repo (incl. CHANGELOG.md if present) on disk.
  2. An awk one-liner extracts the ## <ver> section verbatim — bracket-tolerant. If CHANGELOG.md is missing or no heading matches, falls back to a one-line link.
  3. softprops/action-gh-release@v2 creates the Release with that as the body, attaches dist/*, and stacks generate_release_notes: true on top.

contents: write added to the publish job's permissions (required by the release action). id-token: write for OIDC stays as-is.

Idempotent: updates in place if a Release for the tag already exists.

Test plan

  • First real exercise: the first v*.*.* tag push that ships DCEBE.
  • When a CHANGELOG.md is added later, no workflow change is needed — the awk path becomes the body source automatically.

Tag-push currently uploads to PyPI but does not create a GitHub
Release entry — when DCEBE first ships, the Releases page on
github.com/mstorath/DCEBE will stay empty unless a Release object
is created. This step does that automatically: it tries to extract
the matching `## <version>` section from CHANGELOG.md, falls through
to a tag-commits-link stub if no changelog yet (DCEBE's port is
still in progress), and posts to GitHub Releases via
softprops/action-gh-release@v2 with all build artifacts attached.

Implementation:
- `contents: write` permission added (required by the release action).
  `id-token: write` for OIDC stays.
- `actions/checkout@v4` added so CHANGELOG.md is on disk if/when one
  exists in the repo.
- An awk extractor; defensive fallback to a tag-commits link if no
  CHANGELOG.md or no matching heading.
- `generate_release_notes: true` provides an auto-generated PR/commit
  summary on top — this carries the first DCEBE Release until a
  curated CHANGELOG.md lands.
- Idempotent: updates an existing Release for the tag rather than
  erroring, so manual pre-creation never blocks a re-run.

See devcontainer reports/12-auto-github-release-pattern.md for the
shared pattern and the rationale.
@mstorath mstorath merged commit 68eaadd into master May 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant