You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci(release): derive version from release tag and temporarily rewrite package.json
Update the stable release workflow to extract the version directly from the
GitHub release tag (vX.Y.Z) and temporarily rewrite package.json during CI.
This decouples the release tag source of truth from the source manifest.
Changes:
- Add inline version resolution step that parses stable vX.Y.Z format from tag
- Add temporary package.json rewrite step before verification
- Move verification to validate the rewritten manifest
- Update tests to reflect the new behavior and validate tag format
- Update README documentation for the new release flow
Co-Authored-By: Hagicode <noreply@hagicode.com>
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ ImgBin includes a GitHub Actions based npm publishing workflow for both prerelea
36
36
- Pushes to `main` publish a unique prerelease build to the npm `dev` dist-tag.
37
37
- Pushes to `main` also refresh the GitHub draft release notes through Release Drafter.
38
38
- Stable releases publish only when a GitHub draft release for tag `vX.Y.Z` is published and target the npm `latest` dist-tag.
39
-
- The stable release workflow fails if the release tag version does not exactly match `package.json`.
39
+
- The stable release workflow derives the publish version from the GitHub Release tag, temporarily rewrites `package.json` to that version inside CI, and then verifies the rewritten manifest before publishing.
40
40
41
41
### Release draft flow
42
42
@@ -73,17 +73,17 @@ npm run pack:check
73
73
74
74
For a stable release:
75
75
76
-
1.update `package.json` to the target stable version,
77
-
2.make sure the Release Drafter draft uses the matching tag such as `v0.1.0`, and
76
+
1.make sure the Release Drafter draft uses the target stable tag such as `v0.1.1`,
77
+
2.optionally simulate the workflow locally by rewriting a temporary copy of `package.json` to `0.1.1` and running `node scripts/verify-release-version.mjs v0.1.1 /path/to/temp-package.json`, and
78
78
3. publish that draft release from the GitHub UI.
79
79
80
-
The stable publish workflow checks out the published release tag and validates that it still matches`package.json` before running `npm publish --tag latest`.
80
+
The stable publish workflow checks out the published release tag, resolves `0.1.1` from `v0.1.1`, temporarily rewrites`package.json` to `0.1.1`, and then validates that rewritten manifest before running `npm publish --tag latest`.
81
81
82
82
### Troubleshooting release drafts
83
83
84
84
- If the draft notes are empty or mis-categorized, check the merged PR labels against `repos/imgbin/.github/release-drafter.yml`.
85
85
- If `latest` did not publish after releasing the draft, inspect `repos/imgbin/.github/workflows/npm-publish-dev.yml` for the `release.published` run.
86
-
- If the workflow reports a version mismatch, compare the published release tag with `package.json` and rerun after correcting the version source of truth.
86
+
- If the workflow reports a version mismatch, compare the published release tag with the temporary `package.json`rewrite step output and rerun after correcting the release tag or manifest source.
87
87
- If you need to discard a pending stable release, delete the draft release in GitHub before publishing it.
0 commit comments