Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

# Publishes a GitHub release when plugin.json on main carries a version that
# has no release yet. Notes come from the matching CHANGELOG.md section.
on:
push:
branches: [main]
paths: [plugin.json]
workflow_dispatch:

permissions:
contents: write

concurrency:
group: release
cancel-in-progress: false

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Validate
run: node scripts/validate.mjs
- name: Read version
id: version
run: echo "version=$(node -p "require('./plugin.json').version")" >> "$GITHUB_OUTPUT"
- name: Publish release if missing
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ steps.version.outputs.version }}
run: |
tag="v$VERSION"
if gh release view "$tag" >/dev/null 2>&1; then
echo "Release $tag already exists, nothing to do."
exit 0
fi
node scripts/release-notes.mjs "$VERSION" > notes.md
flags=()
if [[ "$VERSION" == *-* ]]; then flags+=(--prerelease); fi
gh release create "$tag" --target "$GITHUB_SHA" --title "$tag" --notes-file notes.md "${flags[@]}"
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project are documented here. Versions follow [Semant

## [Unreleased]

### Added

- Release workflow: merging a version bump to `main` tags it and publishes a GitHub release, with notes built from this changelog by `scripts/release-notes.mjs`.

## [2.0.0] - 2026-10-17

### Breaking
Expand Down
10 changes: 6 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
| `evals/routing.json` | Routing test cases |
| `scripts/validate.mjs` | Static checks, run in CI |
| `scripts/eval-routing.mjs` | Routing eval, run locally |
| `scripts/release-notes.mjs` | Builds release notes from `CHANGELOG.md` |
| `.github/workflows/release.yml` | Publishes a GitHub release when the version changes |

## Making a change

Expand All @@ -32,9 +34,9 @@ Documentation style: plain ASCII punctuation, no emoji, no em dashes. `validate.

## Releasing

1. Bump the version in `plugin.json` and in both places in `.github/plugin/marketplace.json` (`metadata.version` and the plugin entry).
2. Move the Unreleased changelog notes under a heading for the new version.
3. Run `node scripts/validate.mjs`, then merge to `main`.
4. Tag and publish: `git tag vX.Y.Z && git push origin vX.Y.Z`, then create a GitHub release from the tag.
1. In your PR, bump the version in `plugin.json` and in both places in `.github/plugin/marketplace.json` (`metadata.version` and the plugin entry). Use semver; a version with a suffix such as `2.1.0-rc.1` is published as a prerelease.
2. Move the Unreleased changelog notes under a `## [X.Y.Z] - YYYY-MM-DD` heading.
3. Run `node scripts/validate.mjs` and preview the notes with `node scripts/release-notes.mjs`.
4. Merge to `main`. The Release workflow (`.github/workflows/release.yml`) sees the new version in `plugin.json`, validates, creates the `vX.Y.Z` tag on the merge commit and publishes a GitHub release with the changelog section as notes. If a run fails, fix the cause and re-run it from the Actions tab (it has a manual trigger); it skips versions that are already released.

Users pick up the release with `copilot plugin marketplace update agentcouncil` and `copilot plugin update agentcouncil@agentcouncil`. Listings that pin a tag, such as an awesome-copilot external entry, need their ref bumped separately.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ copilot plugin marketplace add Sentry01/AgentCouncil
copilot plugin install agentcouncil@agentcouncil
```

Update to the latest release:
Update to the latest release ([release notes](https://github.com/Sentry01/AgentCouncil/releases)):

```bash
copilot plugin marketplace update agentcouncil
Expand Down
43 changes: 43 additions & 0 deletions scripts/release-notes.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env node
// Prints GitHub release notes for a version: install and update commands, then
// the matching CHANGELOG.md section. Fails if the section is missing or empty.
// Usage: node scripts/release-notes.mjs [version] [--no-install]
// The version defaults to the one in plugin.json.

import { readFileSync } from "node:fs";
import { dirname, join, resolve } from "node:path";
import { fileURLToPath } from "node:url";

const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const args = process.argv.slice(2);
const version = args.find((a) => !a.startsWith("--")) || JSON.parse(readFileSync(join(root, "plugin.json"), "utf8")).version;

const lines = readFileSync(join(root, "CHANGELOG.md"), "utf8").split("\n");
const start = lines.findIndex((l) => l.startsWith(`## [${version}]`));
if (start < 0) {
console.error(`CHANGELOG.md has no "## [${version}]" section.`);
process.exit(1);
}
const rest = lines.slice(start + 1);
const end = rest.findIndex((l) => l.startsWith("## ["));
const section = (end < 0 ? rest : rest.slice(0, end)).join("\n").trim();
if (!section) {
console.error(`CHANGELOG.md section for ${version} is empty.`);
process.exit(1);
}

const install = `## Install or update

\`\`\`bash
# First install
copilot plugin marketplace add Sentry01/AgentCouncil
copilot plugin install agentcouncil@agentcouncil

# Update an existing install
copilot plugin marketplace update agentcouncil
copilot plugin update agentcouncil@agentcouncil
\`\`\`

`;

process.stdout.write(`${args.includes("--no-install") ? "" : install}${section.replace(/^### /gm, "## ")}\n`);
Loading