Skip to content

chore(release): add release preparation/verification scripts, RC pre-… - #39

Merged
Scrates1 merged 2 commits into
mainfrom
chore/release-pipeline-hardening
Dec 2, 2026
Merged

Scrates1 merged 2 commits into
mainfrom
chore/release-pipeline-hardening

Conversation

@Scrates1

@Scrates1 Scrates1 commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner
## Summary

Hardens the repository's release workflow into a repeatable, PR-first pipeline with automated metadata validation, pre-release (`-rc.N`) support, and `CHANGELOG.md`-driven GitHub Release notes.

## What Changed

- **Release preparation & verification scripts** (`scripts/release-utils.mjs`, `scripts/prepare-release.mjs`, `scripts/verify-release.mjs`):
  - Refuses to prepare a release directly on `main` or a dirty working tree by default.
  - Atomically bumps all 7 versioned files (`VERSION`, `web/package.json`, `web/package-lock.json`, `README.md`, `README.zh-CN.md`, `docs/WINDOWS-UI.en-US.md`, `docs/WINDOWS-UI.zh-CN.md`), inserts a `CHANGELOG.md` stub, and rebuilds `web/dist` via `npm run check`.  
  - Validates tag format (`vX.Y.Z` or `vX.Y.Z-rc.N`), cross-file version alignment, and non-empty `CHANGELOG.md` entries (blocking `TODO`/`TBD` placeholders).
- **Upgraded CI & Release workflows** (`.github/workflows/ci.yml`, `.github/workflows/release.yml`, `.gitattributes`):
  - Runs `node scripts/verify-release.mjs` and `node --test tests/test-release-scripts.mjs` on every PR.
  - Marks `vX.Y.Z-rc.N` tags as GitHub `--prerelease` (ignored by stable in-app update checks) with a pre-release warning banner.
  - Extracts GitHub Release notes directly from `CHANGELOG.md`, verifies `sha256sum -c` locally before upload, excludes `scripts/` from `git archive` release ZIPs, and verifies uploaded release assets via `gh release view`.
- **Tests & documentation** (`tests/test-release-scripts.mjs`, `CONTRIBUTING.md`, `AGENTS.md`):
  - Added 5 unit tests covering tag parsing, changelog extraction/placeholder rejection, release notes formatting, metadata verification, and isolated release-file bumping.
  - Documented the standard branch → PR → 5/5 CI → optional RC smoke test → merge → tag release SOP.

## Verification

- [x] `node scripts/verify-release.mjs`
- [x] `node --test tests/test-release-scripts.mjs` (5/5 passed)
- [x] `git archive` check confirms `scripts/` is excluded from release archives
- [x] `bash tests/test-privacy.sh` and `bash tests/test-linux.sh`
- [x] All 5 GitHub Actions CI checks pass on this PR

@Scrates1
Scrates1 merged commit 27d03a2 into main Dec 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant