ci: publish releases from CI, with a changelog - #61
Open
sidgaikwad wants to merge 1 commit into
Open
Conversation
Publishing was a manual `npm run build && npm publish` from a maintainer's machine. The consequences: the repo has no git tags, no GitHub Releases, no changelog, and packages go out without provenance — so there is no record anywhere of what changed between 1.0.0, 1.0.1 and 1.0.2. Add release.yml, triggered on a v* tag. It re-runs lint, typecheck, tests and build, then publishes with --provenance and creates the GitHub Release with generated notes. It also verifies the tag matches package.json before publishing: a mismatch would put the wrong version under the right tag name on npm, which cannot be undone. Add CHANGELOG.md, backfilled for 1.0.0-1.0.2 from the git history, and a Releasing section in CONTRIBUTING.
|
@sidgaikwad is attempting to deploy a commit to the Unlayer Team on Vercel. A member of the Team first needs to authorize it. |
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.
Fixes #35.
Publishing was a manual
npm run build && npm publishfrom a maintainer's machine.prepublishOnlydid run the checks, which is good — everything around the publish was missing:git tagreturns nothing — nov1.0.0/v1.0.1/v1.0.2)CHANGELOG.md— the only record across three published versions is the pair ofchore(release):commits.github/workflows/release.ymlTriggered on a
v*tag (plusworkflow_dispatch). Re-runs lint / typecheck / test / build, publishes with--provenance, and creates the GitHub Release with generated notes.Three details worth calling out:
$GITHUB_REF_NAMEmatchespackage.json. Publishing 1.0.2's contents under av1.0.3tag is unfixable on npm, so it's worth the five lines. Verified both branches locally:permissions: contents: read; the job addscontents: write(the Release) andid-token: write(provenance requires OIDC).prepublishOnlyso the job fails before anything is published rather than midway through.CHANGELOG.mdBackfilled for 1.0.0–1.0.2 by reading the git history between the release commits, with issue/PR links where I could identify them. Please sanity-check the 1.0.0 entry — there's no history boundary marking it, so it's a placeholder.
Also added a Releasing section to CONTRIBUTING with the tag-and-push flow.
What I could not verify
I have not run this workflow. I validated the YAML parses and exercised the tag-guard shell logic locally, but the publish path can only be proven by a real release. It also needs an
NPM_TOKENrepository secret that doesn't exist yet — worth adding before the first tag, and worth a granular token scoped to this package.Suggested first use: cut
v1.0.3fromUnreleased, or backfill tags at the historical release commits (abed34d= 1.0.1,459e0ad= 1.0.2) first if you want the Releases page to read completely.