mirror of
https://github.com/Fission-AI/OpenSpec.git
synced 2026-09-14 20:16:53 +08:00
807b9d32a6
* Clarify release automation proposal * chore(release): phase 1 – wire up changesets action (dry-run publish) and GitHub release drafting * ci(release): phase 1 – add NODE_AUTH_TOKEN alias and registry/auth config for npm (dry-run)
4.3 KiB
4.3 KiB
Why
Today’s process requires maintainers to merge the Changesets PR, cut a tag, and draft the GitHub release by hand. npm publish then runs from our existing workflow after the GitHub release is published. The human-in-the-loop steps (versioning, tagging, release notes) slow us down and risk drift between npm, tags, and changelog.
What Changes
- Use the single
changesets/actionon pushes tomainto either open/update the version PR or, when the release PR is merged, run our publish command automatically using repository secrets. - Add a
releasescript that builds and runschangeset publishso the action handles version bumps, changelog commits, npm publish, and GitHub releases end-to-end. - Enable
createGithubReleases: trueso GitHub releases are created from the changeset data right after publishing. - Document the automated flow, required secrets, guardrails, and recovery steps (rollback, hotfixes).
Two-Phase Rollout (Two PRs)
-
Phase 1 — Dry run (no publish)
- Update the existing
release-prepare.ymlto wire upchangesets/actionwithcreateGithubReleases: trueand a no-oppublishcommand (e.g.,echo 'dry run'). - Keep
.github/workflows/release-publish.ymlintact. This avoids any publish path changes while we verify that the version PR behavior and permissions are correct. - Add a repository guard (
if: github.repository == 'Fission-AI/OpenSpec') and a concurrency group for safety.
- Update the existing
-
Phase 2 — Enable publish and consolidate
- Add
"release": "pnpm run build && pnpm exec changeset publish"topackage.json. - Change
release-prepare.ymlto usewith: publish: pnpm run releaseandenv: NPM_TOKEN: \\${{ secrets.NPM_TOKEN }}plus the defaultGITHUB_TOKEN. - Remove
.github/workflows/release-publish.ymlto avoid double-publish. Publishing now happens when the version PR is merged.
- Add
Guardrails
- Concurrency:
concurrency: { group: release-\\${{ github.ref }}, cancel-in-progress: false }on the workflow to serialize releases. - Repository/branch guard: run publish logic only on upstream
main(if: github.repository == 'Fission-AI/OpenSpec' && github.ref == 'refs/heads/main'). - Permissions: ensure
contents: writeandpull-requests: writefor opening/updating the version PR;packages: readoptional.
Rollback and Hotfixes
- Rollback: revert the release PR merge (which reverts version bumps/changelog); if a tag or GitHub release was created, delete the tag and release; deprecate the npm version if necessary (
npm deprecate @fission-ai/openspec@x.y.z 'reason'). - Hotfix (urgent, no pending changesets): create a changeset for the fix and merge the release PR; in emergencies, run a manual bump/publish but reconcile with Changesets by adding a follow-up changeset to align versions.
Required Secrets
NPM_TOKENwith publish rights for the@fission-aiscope.- Default
GITHUB_TOKEN(provided by GitHub) for opening/updating the version PR and creating GitHub releases.
How the Maintainer Flow Changes
| Step | Current process | Future process |
|---|---|---|
| Prepare release | Merge changeset PR, then manually draft release notes and tags | Merge release PR; action updates versions and handles changelog automatically |
| Publish npm package | Happens automatically after GitHub release | Happens automatically via changeset publish invoked by the action |
| GitHub release | Draft manually and sync with changelog | Action creates GitHub releases from changeset data |
| Docs/process | Follow manual tagging/release steps | Docs describe automated flow + recovery and hotfix paths |
Impact
- Automation: reuse
.github/workflows/release-prepare.yml(phase 1: dry-run, phase 2: publish) and remove.github/workflows/release-publish.ymlin phase 2. - Package metadata: add
releasescript topackage.json. - Docs: update README or
/docsto show the automated flow, secrets, guardrails, and recovery steps.
Acceptance Criteria
- Phase 1: merges to
mainopen/update a version PR; on merge, the action’spublishstep is a no-op; no npm publish occurs; logs confirm intended behavior; GitHub releases creation is wired but inert due to no publish. - Phase 2: merges to
mainrunpnpm run releasefrom the action; npm package publishes successfully; GitHub release is created automatically;.github/workflows/release-publish.ymlis removed; no duplicate publishes occur.