Skip to content

Create GitHub releases with changelog#4135

Merged
SteffenDE merged 8 commits intophoenixframework:mainfrom
Flo0807:create-github-release-from-tag
Feb 25, 2026
Merged

Create GitHub releases with changelog#4135
SteffenDE merged 8 commits intophoenixframework:mainfrom
Flo0807:create-github-release-from-tag

Conversation

@Flo0807
Copy link
Copy Markdown
Contributor

@Flo0807 Flo0807 commented Jan 29, 2026

closes #4126

  • Add script to extract a specific changelog entry from CHANGELOG.md
  • Add GitHub workflow to automatically create releases on tag push
  • Write changelog entry to release
  • Falls back to the changelog link if the changelog could not be extracted.

Tested in this repo: https://github.com/Flo0807/changelog_test

Creates a workflow that triggers on tag pushes (v*), extracts the
version from the tag, and builds release notes by calling
scripts/extract-changelog.sh
Comment thread .github/workflows/github_release.yml Outdated

# Extract the section for the specified version
# Match from "## vX.Y.Z" until the next "## v" header
awk -v version="$VERSION" '
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While looking at this PR, I remembered this tool exists:

cat CHANGELOG.md | mdq '# "1.8.1"'

returns:

## 1.8.1 (2025-08-28)

### Bug fixes

- [phx.new] Fix AGENTS.md failing to include CSS and JavaScript sections

But using awk seems sensible here to avoid installing a dependency.

Comment thread .github/workflows/github_release.yml Outdated
Comment thread .github/workflows/github_release.yml Outdated
Comment thread .github/workflows/github_release.yml Outdated
@Flo0807 Flo0807 requested a review from SteffenDE January 30, 2026 15:59
@SteffenDE SteffenDE merged commit 52d593c into phoenixframework:main Feb 25, 2026
@SteffenDE
Copy link
Copy Markdown
Collaborator

Let's give it a try, thank you! 🙌

SteffenDE pushed a commit that referenced this pull request Feb 26, 2026
* Add GitHub release workflow

Creates a workflow that triggers on tag pushes (v*), extracts the
version from the tag, and builds release notes by calling
scripts/extract-changelog.sh

* Make script executable

* Simplify if condition

* Use gh cli instead of custom action

* Use `--notes-file` instead of `-F` in gh relase

* Scope permissions and token to release job

* Move extract changelog script to .github

* Fail workflow if changelog cannot be extracted
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.

CHANGELOG.md on main branch is empty, breaking automated changelog detection tools

3 participants