Add release make target and /release skill - #11
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a release workflow for this repository by introducing a make release target and a Claude “/release” skill to guide versioning/changelog updates and release steps.
Changes:
- Add
make releasetarget with branch/sync/clean-tree validation, Hex publish, and GitHub release creation. - Add
.claude/skills/release/SKILL.mddocumenting a guided release process (semver suggestion, changelog/README updates, release branch/PR flow).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| Makefile | Adds a new release target to tag, publish to Hex, and create a GitHub release. |
| .claude/skills/release/SKILL.md | Adds a /release skill document describing a release preparation workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Read the CHANGELOG.md to determine the current version (the most recent version listed at the top). | ||
|
|
There was a problem hiding this comment.
This skill instructs the user to read/update CHANGELOG.md, but the repo currently doesn't include that file. Either add a CHANGELOG.md to the repository (and define its expected format) or adjust the skill to use whatever release notes source this repo actually maintains.
| After the user selects a version bump, update these files: | ||
|
|
||
| ### README.md | ||
| - Find and update the installation example: `{elli_openapi, "~> X.Y.Z"}` |
There was a problem hiding this comment.
The README guidance here doesn't match the current README.md in this repo: there is no Hex dependency example like {elli_openapi, "~> X.Y.Z"} (README currently shows a git dependency). Update the skill to match the actual installation instructions you want users to maintain.
| - Find and update the installation example: `{elli_openapi, "~> X.Y.Z"}` | |
| - Find and update the installation example that uses a git dependency, for example: | |
| ```elixir | |
| {:elli_openapi, github: "elli-lib/elli_openapi", tag: "vX.Y.Z"} |
|
|
||
| Check recent git commits since the last release: | ||
| ```bash | ||
| git log --oneline --since="$(git log -1 --format=%ai $(git describe --tags --abbrev=0 2>/dev/null || echo HEAD))" 2>/dev/null || git log --oneline -20 |
There was a problem hiding this comment.
The git command in Step 2 is overly complex and uses --since=<date of last tag commit>, which can include unrelated commits (e.g., if commits were authored before that date but merged after). A more reliable way to list changes since the last tag is a range like <last_tag>..HEAD (with a fallback when no tags exist).
| git log --oneline --since="$(git log -1 --format=%ai $(git describe --tags --abbrev=0 2>/dev/null || echo HEAD))" 2>/dev/null || git log --oneline -20 | |
| git describe --tags --abbrev=0 >/dev/null 2>&1 && git log --oneline "$(git describe --tags --abbrev=0)"..HEAD || git log --oneline -20 |
| rebar3 hex build && \ | ||
| rebar3 hex publish && \ | ||
| git push origin "$$tag" && \ | ||
| gh release create "$$tag" --title "v$$tag" --notes "$$(sed -n "/## \[$$tag\]/,/## \[/p" CHANGELOG.md | sed '$$d' | tail -n +2)" && \ |
There was a problem hiding this comment.
The sed pattern that extracts the changelog section uses the raw tag in a regex (/## \[$$tag\]/), so tags containing regex metacharacters (notably . in semantic versions) can match unintended headings. Also, when the matching section is the last entry in the file (no following ## [), sed '$d' will drop the final line of the notes. Consider a parser that treats the tag literally and handles EOF correctly (e.g., awk with exact string match, or perl -pe), or rely on gh release create --notes-file/--generate-notes.
| gh release create "$$tag" --title "v$$tag" --notes "$$(sed -n "/## \[$$tag\]/,/## \[/p" CHANGELOG.md | sed '$$d' | tail -n +2)" && \ | |
| gh release create "$$tag" --title "v$$tag" --notes "$$(awk -v tag="$$tag" ' \ | |
| $$0 == "## [" tag "]" {found=1; next} \ | |
| found && /^## \[/ {exit} \ | |
| found {print} \ | |
| ' CHANGELOG.md)" && \ |
| rebar3 hex build && \ | ||
| rebar3 hex publish && \ | ||
| git push origin "$$tag" && \ | ||
| gh release create "$$tag" --title "v$$tag" --notes "$$(sed -n "/## \[$$tag\]/,/## \[/p" CHANGELOG.md | sed '$$d' | tail -n +2)" && \ |
There was a problem hiding this comment.
The tag prompt suggests entering something like v1.0.0, but the release title is set to v$$tag, which will produce titles like vv1.0.0. Decide whether tags include the leading v and keep it consistent across the prompt, the tag name, and the GitHub release title.
| gh release create "$$tag" --title "v$$tag" --notes "$$(sed -n "/## \[$$tag\]/,/## \[/p" CHANGELOG.md | sed '$$d' | tail -n +2)" && \ | |
| gh release create "$$tag" --title "$$tag" --notes "$$(sed -n "/## \[$$tag\]/,/## \[/p" CHANGELOG.md | sed '$$d' | tail -n +2)" && \ |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
make releasetarget that validates branch/sync state, prompts for tag, publishes to hex.pm, and creates a GitHub release.claude/skills/release/SKILL.md— a/releaseskill that analyzes commits, suggests a semver bump, updates CHANGELOG.md and README.md, and creates a release branch/PRTest plan
make releaseruns correctly frommainwith a clean working tree/releaseskill guides through version bump and file updates correctly🤖 Generated with Claude Code