Repository navigation
Conversation
Every push to main still publishes :latest. After the build, semantic-release derives the next version from the Conventional Commits since the last release, creates the v<version> tag, tags the pushed image digest as :<version> and :sha-<short-sha>, and then creates the GitHub release. A tag pushed with GITHUB_TOKEN starts no workflow, so the v* tag trigger is gone. Publish runs are serialized per ref so :latest and releases follow the push order. Dependabot's Dockerfile updates use the fix prefix so they release a patch version. Co-authored-by: Innie of Bokvi <innie@bokvi.com>
Run the image tagging in the prepare step, so a failed retag leaves no v* tag behind and a re-run can release the version. Name the sha- tag after the built commit. Co-authored-by: Innie of Bokvi <innie@bokvi.com>
The release job has write access to tags, releases and GHCR, so install its whole dependency tree from release/package-lock.json with npm ci instead of resolving it on every run. Dependabot keeps the lockfile up to date. Co-authored-by: Innie of Bokvi <innie@bokvi.com>
Co-authored-by: Innie of Bokvi <innie@bokvi.com>
Co-authored-by: Innie of Bokvi <innie@bokvi.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.
Adds automated versioning and GitHub releases.
:latestis still published on every push tomain.This replaces #7: a follow-up commit there broke commitlint's 72-character header limit, so this branch carries the same change as one clean commit.
What changes
.releaserc.json: semantic-release onmainwith theconventionalcommitspreset: a breaking change (!/BREAKING CHANGE:) → major,feat→ minor,fix/perf→ patch, any other type → no release. The plugins run in this order:verifyConditionsCmdchecks that the image digest from the build exists before any tag is created.prepareCmdrunsdocker buildx imagetools createto tag that digest as:X.Y.Zand:sha-<short>(no rebuild). semantic-release runspreparebefore it creates and pushes thev*tag, so if tagging the image fails, no tag is left behind and a re-run can release the version.contents: write.Nothing is committed back to
main; its ruleset blocks direct pushes.publish.yml:buildpushes:latest(andci-bokvi) as before, and now outputs the digest it pushed.releasejob (needs: build,mainonly) runs semantic-release. It installs the whole dependency tree fromrelease/package-lock.jsonwithnpm ci --ignore-scripts, since the job can push tags, releases and images, and checks out withpersist-credentials: false.concurrencygroup (publish-<ref>, no cancellation) runs publishes one at a time, so:latestand releases follow push order.tags: ['v*']trigger is removed. A tag pushed withGITHUB_TOKENstarts no workflow, so the image is tagged inside the release job, and nobody pushesv*tags by hand.dependabot.yml: the rootDockerfileecosystem now uses thefixprefix, so Node.js 24 updates release a patch version. Withchorethey would only reach:latest. A newnpmentry for/releasekeeps the lockfile updated, but not to the conventionalcommits preset's next major.README / CONTRIBUTING: the tag table, the publishing steps and the release process now describe the automated flow.
conventional-changelog-conventionalcommitsstays on 9.x: 10.x needsconventional-changelog-writer@9, but@semantic-release/release-notes-generator@14ships writer 8. With 10.4.1, the dry run failed ingenerateNotes.Assumptions
:lateststays on every push tomain, as before. Versioned tags are added on top.featcommits go into its notes.Follow-ups (not in this PR)
:X/:X.Ytags.org.opencontainers.image.versionlabel stayslateston versioned tags.imagetools createre-tags the manifest and can't change labels.release-guard:Dotykacka/docs-gitis private, so a bokvi workflow can't use it, and this repo has norelease/*branches.v*tag is pushed, delete the tag and re-run.ghcr.io/actions/actions-runner:latestisn't pinned, so upstream runner updates only reach:latestuntil the next release (pre-existing).:latestback to the older commit.Proof
There's no UI to screenshot before merge. This is a semantic-release dry run of the branch with the locked
release/install,IMAGE=ghcr.io/bokvi/actions-runnerandDIGESTset to the current:latestdigest:With
DIGESTempty,verifyConditionsfails (EVERIFYCONDITIONS … imagetools inspect) before any tag is created. The renderedprepareCmd(apreparestep is skipped in dry-run mode) is:It expands to
-t img:1.0.0 -t img:sha-1f828c8 img@sha256:….actionlintpasses. Screenshots of the v1.0.0 release and the:1.0.0package tag will be added after the merge run.