chore: support semver releases using gh actions#8
Conversation
elbandito
commented
Oct 5, 2025
- Added gh action to assist in semantic version releases
- Fixed bad URL path in readme
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| - name: Commit and push changes | ||
| run: | | ||
| git add package.json package-lock.json | ||
| git commit -m "chore: release v${{ github.event.inputs.version }}" | ||
| git push origin main | ||
|
|
||
| - name: Create Git tag | ||
| run: | | ||
| git tag v${{ github.event.inputs.version }} | ||
| git push origin v${{ github.event.inputs.version }} | ||
|
|
||
| - name: Publish to npm | ||
| run: npm publish --access public |
There was a problem hiding this comment.
Avoid pushing release commit/tag before npm publish succeeds
The workflow pushes the version bump to main and creates the Git tag before running npm publish. If publishing fails (e.g., transient registry errors or an already-used version), the repository is left with a committed version bump and a pushed tag that cannot be republished, leaving the codebase in a broken release state that requires manual cleanup and a new version number. Consider performing npm publish first and only pushing the commit and tag after the publish step succeeds, or adding rollback logic.
Useful? React with 👍 / 👎.
5ef81f2 to
7f6b1b6
Compare