Skip to content

Add release make target and /release skill - #11

Merged
andreashasse merged 3 commits into
mainfrom
add_release_skill_and_make_target
Mar 27, 2026
Merged

andreashasse merged 3 commits into
mainfrom
add_release_skill_and_make_target

Conversation

@andreashasse

Copy link
Copy Markdown
Owner

Summary

  • Adds make release target that validates branch/sync state, prompts for tag, publishes to hex.pm, and creates a GitHub release
  • Adds .claude/skills/release/SKILL.md — a /release skill that analyzes commits, suggests a semver bump, updates CHANGELOG.md and README.md, and creates a release branch/PR

Test plan

  • Verify make release runs correctly from main with a clean working tree
  • Verify /release skill guides through version bump and file updates correctly

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

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.

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 release target with branch/sync/clean-tree validation, Hex publish, and GitHub release creation.
  • Add .claude/skills/release/SKILL.md documenting 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.

Comment on lines +12 to +13
Read the CHANGELOG.md to determine the current version (the most recent version listed at the top).

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
After the user selects a version bump, update these files:

### README.md
- Find and update the installation example: `{elli_openapi, "~> X.Y.Z"}`

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
- 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"}

Copilot uses AI. Check for mistakes.

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

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

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

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).

Suggested change
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

Copilot uses AI. Check for mistakes.
Comment thread Makefile
Comment thread Makefile
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)" && \

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
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)" && \

Copilot uses AI. Check for mistakes.
Comment thread .claude/skills/release/SKILL.md Outdated
Comment thread Makefile
Comment thread Makefile
Comment thread Makefile
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)" && \

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
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)" && \

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@andreashasse
andreashasse merged commit a3592d2 into main Mar 27, 2026
2 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.

2 participants