Skip to content

Commit 11f6fcc

Browse files
authored
Merge pull request #8 from d3cker/release
Release v0.6.3
2 parents 59b22ff + 0f84630 commit 11f6fcc

18 files changed

Lines changed: 1038 additions & 96 deletions

‎.github/release-state.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"pullRequest": 7,
3+
"sourceSHA": "0607dc761f2bff2bafca5c820f1427109cc13fde",
4+
"version": "0.6.3"
5+
}

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ name: CI
22

33
on:
44
pull_request:
5-
push:
6-
branches: [main, master]
7-
workflow_dispatch:
5+
branches: [release]
6+
types: [opened, synchronize, reopened, ready_for_review, edited]
87

98
permissions:
109
contents: read
@@ -34,6 +33,8 @@ jobs:
3433
cache: npm
3534
- name: Install dependencies
3635
run: npm ci
36+
- name: Verify release notes and manifests
37+
run: node scripts/release-pipeline.mjs verify-feature
3738
- name: Lint, typecheck, test, and build
3839
run: npm run check
3940
- name: Verify package installation

‎.github/workflows/promotion.yml‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release promotion
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
types: [opened, synchronize, reopened, ready_for_review, edited]
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: promotion-${{ github.event.pull_request.number }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
ready:
17+
name: Release ready
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 5
20+
steps:
21+
- name: Check out the proposed release head
22+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
23+
with:
24+
ref: ${{ github.event.pull_request.head.sha }}
25+
fetch-depth: 0
26+
persist-credentials: false
27+
- name: Set up Node.js
28+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
29+
with:
30+
node-version: 22
31+
cache: npm
32+
- name: Install validation dependencies
33+
run: npm ci --ignore-scripts
34+
- name: Verify published version and README without building a package
35+
env:
36+
GH_TOKEN: ${{ github.token }}
37+
run: node scripts/release-pipeline.mjs verify-promotion

‎.github/workflows/release.yml‎

Lines changed: 24 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,51 @@
11
name: Release
22

33
on:
4+
pull_request:
5+
branches: [release]
6+
types: [closed]
47
push:
58
tags: ['v[0-9]*', '[0-9]*']
69

710
permissions:
811
contents: read
912

13+
# Automatic and manual releases share one publisher. Never cancel an active publication.
1014
concurrency:
11-
group: release-${{ github.ref }}
15+
group: release-publication
1216
cancel-in-progress: false
1317

1418
jobs:
15-
package:
16-
name: Build and verify release package
19+
release:
20+
name: Publish from release and open promotion PR
21+
if: github.event_name == 'push' || github.event.pull_request.merged == true
1722
runs-on: ubuntu-latest
18-
timeout-minutes: 15
19-
outputs:
20-
prerelease: ${{ steps.version.outputs.prerelease }}
21-
filename: ${{ steps.package.outputs.filename }}
23+
timeout-minutes: 25
24+
permissions:
25+
contents: write
26+
pull-requests: write
2227
steps:
23-
- name: Check out the tag
28+
- name: Check out release
2429
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2530
with:
26-
persist-credentials: false
31+
ref: release
32+
fetch-depth: 0
2733
- name: Set up Node.js
2834
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
2935
with:
3036
node-version: 22
3137
cache: npm
32-
- name: Install dependencies
33-
run: npm ci
34-
- name: Verify package version matches tag
35-
id: version
38+
- name: Install pipeline dependencies
39+
run: npm ci --ignore-scripts
40+
- name: Prepare version, publish package, and promote through a PR
3641
env:
37-
RELEASE_TAG: ${{ github.ref_name }}
38-
run: node scripts/release-version.mjs "$RELEASE_TAG"
39-
- name: Lint, typecheck, test, and build
40-
run: npm run check
41-
- name: Pack and verify installation
42-
id: package
43-
run: npm run package:check -- "$RUNNER_TEMP/release"
44-
- name: Upload verified release files
42+
GH_TOKEN: ${{ github.token }}
43+
run: node scripts/release-pipeline.mjs
44+
- name: Preserve built release files for diagnostics
45+
if: always()
4546
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
4647
with:
4748
name: release-package
48-
path: |
49-
${{ runner.temp }}/release/*.tgz
50-
${{ runner.temp }}/release/*.sha256
51-
if-no-files-found: error
49+
path: ${{ runner.temp }}/release/*
50+
if-no-files-found: ignore
5251
retention-days: 7
53-
54-
publish:
55-
name: Publish GitHub Release
56-
needs: package
57-
runs-on: ubuntu-latest
58-
timeout-minutes: 5
59-
permissions:
60-
contents: write
61-
steps:
62-
- name: Download verified release files
63-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
64-
with:
65-
name: release-package
66-
path: release
67-
- name: Create release with package and checksum
68-
working-directory: release
69-
env:
70-
GH_TOKEN: ${{ github.token }}
71-
RELEASE_TAG: ${{ github.ref_name }}
72-
PRERELEASE: ${{ needs.package.outputs.prerelease }}
73-
PACKAGE_FILE: ${{ needs.package.outputs.filename }}
74-
run: |
75-
sha256sum --check "$PACKAGE_FILE.sha256"
76-
args=(--repo "$GITHUB_REPOSITORY" --verify-tag --title "$RELEASE_TAG" --generate-notes)
77-
if [[ "$PRERELEASE" == "true" ]]; then
78-
args+=(--prerelease --latest=false)
79-
fi
80-
gh release create "$RELEASE_TAG" "$PACKAGE_FILE" "$PACKAGE_FILE.sha256" "${args[@]}"

‎AGENTS.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Use English for all user-facing prompts, UI labels, errors, generated bot messages, examples, and documentation. Do not hard-code a personal account in defaults.
44

5+
Never push commits directly to `main` or modify its files through GitHub APIs.
6+
All changes reach `main` by merging a PR from `release`. Feature PRs target
7+
`release`; version and post-publication README commits belong on `release`.
8+
59
## Project context
610

711
This repository implements issue-to-PR automation for OpenCode **2**: a scheduler,
@@ -24,6 +28,7 @@ steps, project setup, headless operation, and removal.
2428
| [docs/runtime.md](docs/runtime.md) | User-visible behavior while the bot runs: GitHub questions and permission replies, branch selection, media inputs, prompt loading, follow-up comments, session tabs, and routine management commands. | Use when changing issue conversations, session continuation, runtime tools, or TUI behavior. |
2529
| [docs/advanced.md](docs/advanced.md) | Separate scheduler/dispatcher setup, multiple repositories, custom RPC jobs, full options, timeouts, management and retry commands, persistence, reconciliation, locks, and known limits. | Use for low-level configuration, operational troubleshooting, recovery, or ownership/concurrency changes. |
2630
| [docs/installation.md](docs/installation.md) | Loader registration, config-directory precedence, prerequisites, source installation, project-local installation, upgrade conflicts, testing on another machine, and migration limits. | Use when working on packaging, installers, registration, upgrades, or deployment troubleshooting. |
31+
| [docs/releases.md](docs/releases.md) | Feature-to-release PR checks, automatic patch versions, manual npm version/tag releases, exact changelog notes, publication recovery, README commits on release, and promotion PRs into protected main. | Use for CI triggers, versioning, packaging, GitHub Release publication, branch permissions, or recovery after a failed release. |
2732

2833
For common investigations:
2934

@@ -38,6 +43,12 @@ For common investigations:
3843
- **Why is polling inactive or duplicated?** Read architecture ownership,
3944
workflow section 1, and installation registration details.
4045

46+
For release changes, read `docs/releases.md`, `CHANGELOG.md`, and the workflows
47+
under `.github/workflows/`. `scripts/release-pipeline.mjs` handles automatic and
48+
manual releases, retry state, and promotion. `scripts/release-notes.mjs` extracts
49+
the exact tagged changelog section; `scripts/update-release-readme.mjs` renders
50+
the installation block without making remote writes. Keep its markers intact.
51+
4152
## From documentation to source
4253

4354
- `src/index.ts` loads the combined plugin; `src/plugins/` contains the scheduler

‎CHANGELOG.md‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Changelog
2+
3+
Release descriptions come from the exact version section committed with the tag.
4+
Add feature changes under `Unreleased`; after a PR merges into `release`, automation
5+
moves them into the new patch version's section. For a manual release, prepare
6+
and commit the exact version section before creating its tag. Prerelease headings
7+
include the full version, for example `## 0.7.0-beta.1`.
8+
9+
## Unreleased
10+
11+
## 0.6.3
12+
13+
### Fixed
14+
15+
- Generate release descriptions from the matching changelog section, so publishing
16+
a tag before its PR merges no longer produces notes about an earlier release.
17+
- Show the latest published stable package's versioned download URL in the README
18+
on `release` after successful publication, then promote it to `main` through a PR.
19+
20+
### Release process
21+
22+
- Run full CI when feature PRs target `release`, including new commits to open PRs.
23+
Ordinary feature pushes no longer run CI or build packages.
24+
- Publish an automatic patch after a PR merges into `release`, and support manual
25+
version tags on that branch without a second version bump.
26+
- Recover interrupted publication without moving tags or republishing completed
27+
packages. Commit README on `release` before opening or updating its PR to `main`.
28+
- Keep `main` changes behind PR merges and verify that promotion contains the
29+
published package's code and updated download links.
30+
31+
## 0.6.2
32+
33+
### Fixed
34+
35+
- Keep the automation owner service active with a heartbeat during long-running
36+
worker sessions, preserving dispatcher access for task completion and PR publication.
37+
- Verify the owner process before sending heartbeat requests and prevent overlapping
38+
requests with a bounded timeout.
39+
- Attempt every cleanup step during shutdown, releasing scheduler and dispatcher
40+
locks even when another cleanup fails, so the plugin can start again.
41+
42+
### Validation and documentation
43+
44+
- Add regression coverage for owner heartbeats and shutdown cleanup failures.
45+
- Document owner lifetime, lock cleanup, and recovery behavior.
46+
47+
## 0.6.1
48+
49+
### Documentation
50+
51+
- Add detailed bot workflow diagrams and a documentation map in `AGENTS.md`.
52+
- Expand bundled bot instructions for planning, delegation, verification, and
53+
handing publication back to the dispatcher.
54+
- Add the README banner showing an OpenCode2 agent executing a task.

‎README.md‎

Lines changed: 57 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,28 @@ Nothing needs to be published to npm. `$HOME` expands to your home directory.
2323

2424
## Install from a .tgz package
2525

26-
1. Download/copy the archive to the machine running OpenCode 2 and install it
27-
(replace `VERSION` with the downloaded version):
26+
Run this command on the machine running OpenCode 2:
2827

29-
```bash
30-
npm install --global --prefix "$HOME/.local" "$HOME/Downloads/opencode2-automation-VERSION.tgz"
31-
```
28+
<!-- latest-release:start -->
29+
Latest stable release: **[v0.6.3](https://github.com/d3cker/opencode2-github-automation/releases/tag/v0.6.3)**.
3230

33-
`postinstall` registers both the plugin and TUI automatically. No `sudo`,
34-
source checkout, or manual config editing is needed. Do not add
35-
`--ignore-scripts`; npm needs network access to install dependencies.
31+
[Download the .tgz package](https://github.com/d3cker/opencode2-github-automation/releases/download/v0.6.3/opencode2-automation-0.6.3.tgz) · [SHA-256 checksum](https://github.com/d3cker/opencode2-github-automation/releases/download/v0.6.3/opencode2-automation-0.6.3.tgz.sha256)
3632

37-
2. Restart the service when its sessions are idle:
33+
```bash
34+
npm install --global --prefix "$HOME/.local" "https://github.com/d3cker/opencode2-github-automation/releases/download/v0.6.3/opencode2-automation-0.6.3.tgz"
35+
```
36+
<!-- latest-release:end -->
3837

39-
```bash
40-
opencode2 service restart
41-
```
38+
`postinstall` registers both the plugin and TUI automatically. No `sudo`,
39+
source checkout, or manual config editing is needed. Do not add
40+
`--ignore-scripts`; npm needs network access to install dependencies.
41+
You can also download the archive and pass its local path to the same command.
42+
43+
Restart the service when its sessions are idle:
44+
45+
```bash
46+
opencode2 service restart
47+
```
4248

4349
The CLI is now at `$HOME/.local/bin/opencode2-automation`. If `$HOME/.local/bin`
4450
is on your PATH, you can use the shorter `opencode2-automation` command.
@@ -122,15 +128,13 @@ A reboot-only task does not handle later `opencode2 service restart` calls.
122128

123129
## Update from a .tgz package
124130

125-
Wait for active bot work to finish. Download the new archive, then:
131+
Wait for active bot work to finish, then:
126132

127-
1. Install the new file using the **same prefix** as before:
133+
1. Run the versioned command in [Install from a .tgz package](#install-from-a-tgz-package)
134+
using the **same prefix** as before. After publication, the README on `release`
135+
links to the new stable package; `main` receives that link through the promotion PR.
128136

129-
```bash
130-
npm install --global --prefix "$HOME/.local" /absolute/path/to/opencode2-automation-NEW_VERSION.tgz
131-
```
132-
133-
Replace the example path with your archive. `postinstall` refreshes registration;
137+
`postinstall` refreshes registration;
134138
project settings and queues are preserved. Do not run `init` again.
135139

136140
2. Reload the service:
@@ -287,22 +291,41 @@ copy it to another machine and follow the `.tgz` instructions above.
287291

288292
## GitHub Actions and releases
289293

290-
- **Pull requests:** CI runs ESLint, type checking, unit tests, a build, and a
291-
package installation check on Node 22 and 24. Pushes to `main`/`master` also run CI.
292-
- **Releases:** push a SemVer tag to build and publish a GitHub Release with the
293-
`.tgz` and SHA-256 checksum. CI verifies that the tag matches the committed
294-
version in `package.json` and `package-lock.json`. Tests and package installation must pass.
295-
296-
For a stable release, merge the PR first, then update your local `main` branch.
297-
With a clean working tree, run (replace `0.6.0` with your next unused version):
294+
1. Work on a feature branch and add release notes under `Unreleased` in
295+
[CHANGELOG.md](CHANGELOG.md). Ordinary branch pushes do not run CI or publish packages.
296+
2. Open a PR into the long-lived `release` branch. CI runs lint, type checking,
297+
tests, a build, and an installation check on Node 22 and 24. New commits to
298+
the open PR rerun these checks. Review and merge after they pass.
299+
3. The merge starts **Release**. It increments the patch version on `release`,
300+
moves the unreleased notes into that version's changelog section, and pushes
301+
the version commit and tag atomically. It builds and verifies the tagged
302+
package, then publishes the GitHub Release with `.tgz`, SHA-256, and exact
303+
version notes. No package is published to npm.
304+
4. Only after publication succeeds, automation commits the versioned README link
305+
on `release` and opens or updates a PR from `release` into `main`.
306+
5. Review and merge that PR with a **merge commit**. All code, version metadata,
307+
release notes, and README changes reach protected `main` through this PR.
308+
The automation never pushes to `main` or writes its files through the API.
309+
310+
To choose a version manually, prepare and commit its exact changelog section on
311+
`release`, then use `npm version`, for example:
298312

299313
```bash
300-
npm version 0.6.0
301-
git push --atomic origin HEAD v0.6.0
314+
git switch release
315+
git pull --ff-only origin release
316+
# Prepare and commit the CHANGELOG.md section for 1.0.0 first.
317+
npm version 1.0.0
318+
git push --atomic origin release v1.0.0
302319
```
303320

304-
`npm version` updates both manifests, creates a commit, and tags it automatically.
305-
The push sends the current branch and tag together. For testing, use a version
306-
such as `0.7.0-beta.1` on a feature branch; CI marks it as a prerelease.
307-
CI does not rewrite versions or publish to npm. Releases use the built-in
308-
`GITHUB_TOKEN`; no npm token or extra secret is needed.
321+
The pushed tag publishes exactly `1.0.0`, without another version bump. Both
322+
`v1.0.0` and `1.0.0` tag names are accepted. The next automatic patch is `1.0.1`.
323+
Version tags must point to code on `release`; ordinary pushes to that branch
324+
never start publication. Finish the active release before merging another feature.
325+
326+
The README on `release` is updated after publication; the README on `main` changes
327+
when the promotion PR is merged. The tag and packaged README remain snapshots
328+
from before the later README commit.
329+
330+
See [Release process](docs/releases.md) for required repository permissions,
331+
branch protection, CI approval for bot PRs, concurrency, and safe retry procedures.

‎docs/installation.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ Start with the [README](../README.md) for `.tgz` or source installation, updates
44
project configuration, headless startup, and removal. This page covers details
55
and troubleshooting.
66

7+
The README's package installation command contains the versioned GitHub asset URL
8+
for the stable release promoted into that branch. After publication, automation
9+
updates README on `release`; its PR carries the update into `main` when merged.
10+
While that PR awaits review, `release` contains the newer download link. For
11+
upgrades, use that branch's current README rather than a copy from an old archive
12+
or tag, and keep the same installation prefix. Prereleases do not replace the
13+
stable link. Maintainer setup and retries are in [Release process](releases.md).
14+
715
## Package registration
816

917
`npm install --global` runs the bundled `postinstall` script. It writes two small

0 commit comments

Comments
 (0)