Tag before publishing again, and roll the tag back on failure - #191
Merged
Merged
Conversation
Moving `git tag` after `rebar3 hex publish` broke releases a different
way: `spectra.app.src` uses `{vsn, "git"}`, so rebar3 derives the
version from `git describe`. With no tag on HEAD that produced
`0.13.4+build.429.ref3e72b46`, which Hex rejects with "build number not
allowed".
Tag before compiling again so the version resolves, but wrap the
publish steps so a failure deletes the local tag. That keeps the
original problem fixed: no stray tag blocking the retry. The tag is
only kept once publishing succeeded, which is also the point before
anything has been pushed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #190, which fixed the missing
rebar3_hexplugin but broke releases a different way:Why
src/spectra.app.srcdeclares{vsn, "git"}, so rebar3 derives the package version fromgit describe. PR #190 movedgit tagto afterrebar3 hex publishto avoid leaving a stray tag behind on failure, but that meant no tag pointed at HEAD when the version was resolved.git describethen produced a build-number suffix, which Hex rejects.What changed
Tag before
rebar3 compileagain so the version resolves cleanly, but wrap the compile/build/publish steps in anifand delete the local tag when they fail. That keeps the stray-tag problem fixed. The tag now survives only once publishing succeeded, which is also before anything has been pushed, so the rollback never has to undo a remote change.Testing
Verified the recipe is valid shell with
sh -n, and exercised the failure path in a scratch repository: the tag is created, publish fails, the tag is deleted, and the target exits non-zero.🤖 Generated with Claude Code