|
| 1 | +# Stackpress GitHub Release Workflow |
| 2 | + |
| 3 | +Use this workflow to draft, review, and publish synchronized GitHub releases for |
| 4 | +the coordinated Stackpress release set, especially when GitHub Releases have |
| 5 | +fallen behind package versions. |
| 6 | + |
| 7 | +This workflow manages GitHub releases only. It does not publish packages, change |
| 8 | +package versions, push commits, rewrite tags, or create release branches. |
| 9 | + |
| 10 | +## Read First |
| 11 | + |
| 12 | +1. [Compatibility And Maintenance](../context/compatibility-and-maintenance.md) |
| 13 | + for the authoritative release set and compatibility boundaries. |
| 14 | +2. The `AGENTS.md` in every local sibling repository that will be inspected. |
| 15 | +3. Current remote manifests and GitHub release state; do not rely on stale local |
| 16 | + tags when public release state can be checked directly. |
| 17 | + |
| 18 | +## Release Set And Version Sources |
| 19 | + |
| 20 | +Use this order throughout the workflow: |
| 21 | + |
| 22 | +| Repository | Coordinated manifests | |
| 23 | +| --- | --- | |
| 24 | +| `stackpress/lib` | `package.json` | |
| 25 | +| `stackpress/idea` | `packages/idea/package.json`, `packages/idea-parser/package.json`, `packages/idea-transformer/package.json` | |
| 26 | +| `stackpress/ingest` | `ingest/package.json` | |
| 27 | +| `stackpress/inquire` | `packages/inquire*/package.json` | |
| 28 | +| `stackpress/reactus` | `reactus/package.json` | |
| 29 | +| `stackpress/stackpress` | root `package.json` and active `packages/*/package.json` | |
| 30 | + |
| 31 | +Exclude examples, templates, documentation helpers, generated `cjs`/`esm` |
| 32 | +manifests, planning-only directories, and the Idea language extension. |
| 33 | + |
| 34 | +## 1. Establish The Target |
| 35 | + |
| 36 | +1. Read the intended version from the coordinated manifests on each remote |
| 37 | + default branch. |
| 38 | +2. Require every coordinated manifest to contain the same exact version. |
| 39 | +3. Use that version as the stable tag without a `v` prefix. |
| 40 | +4. Record each default branch and target commit SHA. |
| 41 | +5. Stop on any version mismatch, missing manifest, local-only unpublished |
| 42 | + version change, or target tag/release collision. |
| 43 | + |
| 44 | +Do not repair a mismatch as part of release catch-up unless the user separately |
| 45 | +authorizes the version changes and their commits. |
| 46 | + |
| 47 | +## 2. Establish Each Comparison Boundary |
| 48 | + |
| 49 | +For each repository, query GitHub's latest published stable release. Use the |
| 50 | +published release rather than the newest tag because stray, prerelease, or |
| 51 | +unpublished tags must not silently change the notes boundary. |
| 52 | + |
| 53 | +```bash |
| 54 | +gh api repos/stackpress/<repo>/releases/latest --jq .tag_name |
| 55 | +``` |
| 56 | + |
| 57 | +Record the previous release, target version, default-branch SHA, compare URL, |
| 58 | +and commit count. If no prior published release exists, report that the notes |
| 59 | +cover the repository's full history and ask before continuing. |
| 60 | + |
| 61 | +## 3. Generate Repository-Specific Notes |
| 62 | + |
| 63 | +Generate notes independently for all six repositories. The version is shared; |
| 64 | +the change summaries are not. |
| 65 | + |
| 66 | +```bash |
| 67 | +gh api --method POST repos/stackpress/<repo>/releases/generate-notes \ |
| 68 | + -f tag_name=<version> \ |
| 69 | + -f target_commitish=<default-branch> \ |
| 70 | + -f previous_tag_name=<previous-release> |
| 71 | +``` |
| 72 | + |
| 73 | +Use GitHub's output as a baseline, then review the complete comparison and add |
| 74 | +material direct-to-branch changes that generated notes omit. Keep user-facing |
| 75 | +features, fixes, migration notes, and breaking changes above maintenance-only |
| 76 | +details. Preserve pull-request and contributor links. |
| 77 | + |
| 78 | +If a repository has no user-facing changes, state that plainly. Do not omit it |
| 79 | +from the release set merely because another repository contains the primary |
| 80 | +change. |
| 81 | + |
| 82 | +## 4. Review Gate |
| 83 | + |
| 84 | +Before any release mutation, present: |
| 85 | + |
| 86 | +- one boundary table covering all six repositories; |
| 87 | +- the six complete release-note drafts; |
| 88 | +- version, tag style, target branch, and target SHA; |
| 89 | +- any existing tags, prereleases, ambiguous boundaries, or empty comparisons; |
| 90 | +- the exact `gh release` operations proposed. |
| 91 | + |
| 92 | +Obtain explicit user approval to create drafts or publish releases. Approval of |
| 93 | +release notes alone is not approval to publish. |
| 94 | + |
| 95 | +## 5. Create Draft Releases |
| 96 | + |
| 97 | +After approval, create drafts first so the full coordinated set can be checked |
| 98 | +before publication: |
| 99 | + |
| 100 | +```bash |
| 101 | +gh release create <version> \ |
| 102 | + --repo stackpress/<repo> \ |
| 103 | + --target <default-branch> \ |
| 104 | + --title <version> \ |
| 105 | + --notes-file <repo-notes-file> \ |
| 106 | + --draft |
| 107 | +``` |
| 108 | + |
| 109 | +Create drafts in release-set order. Verify every draft's version, target, title, |
| 110 | +notes, draft state, and prerelease state. If any draft fails, stop and report |
| 111 | +the partial set; do not delete drafts, tags, or published releases automatically. |
| 112 | + |
| 113 | +## 6. Publish The Coordinated Set |
| 114 | + |
| 115 | +Publishing requires a second explicit approval after draft verification. Publish |
| 116 | +in release-set order: |
| 117 | + |
| 118 | +```bash |
| 119 | +gh release edit <version> \ |
| 120 | + --repo stackpress/<repo> \ |
| 121 | + --draft=false \ |
| 122 | + --latest |
| 123 | +``` |
| 124 | + |
| 125 | +After each publication, verify the release URL, tag, target commit, and published |
| 126 | +state. A partial failure must stop the sequence and be reported immediately. |
| 127 | +Never move or delete an already published tag as automatic recovery. |
| 128 | + |
| 129 | +## 7. Closeout |
| 130 | + |
| 131 | +Report: |
| 132 | + |
| 133 | +- the shared released version; |
| 134 | +- all six release URLs and target SHAs; |
| 135 | +- the previous-to-current comparison used for each repository; |
| 136 | +- any repository with no user-facing changes; |
| 137 | +- partial drafts, publication failures, or follow-up corrections; |
| 138 | +- confirmation that package publication and source pushes were not performed. |
| 139 | + |
| 140 | +If only drafts were requested, state clearly that no release was published. |