feat: migrate repo releases to manual release-please (#293)

This commit is contained in:
Trevin Chow
2026-03-17 17:58:13 -07:00
committed by GitHub
parent 74fb71731a
commit f47f829d81
44 changed files with 1967 additions and 801 deletions

6
.github/.release-please-manifest.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
".": "2.42.0",
"plugins/compound-engineering": "2.42.0",
"plugins/coding-tutor": "1.2.1",
".claude-plugin": "1.0.0"
}

64
.github/release-please-config.json vendored Normal file
View File

@@ -0,0 +1,64 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"include-component-in-tag": true,
"packages": {
".": {
"release-type": "simple",
"package-name": "cli",
"changelog-path": "CHANGELOG.md",
"extra-files": [
{
"type": "json",
"path": "package.json",
"jsonpath": "$.version"
}
]
},
"plugins/compound-engineering": {
"release-type": "simple",
"package-name": "compound-engineering",
"changelog-path": "../../CHANGELOG.md",
"extra-files": [
{
"type": "json",
"path": ".claude-plugin/plugin.json",
"jsonpath": "$.version"
},
{
"type": "json",
"path": ".cursor-plugin/plugin.json",
"jsonpath": "$.version"
}
]
},
"plugins/coding-tutor": {
"release-type": "simple",
"package-name": "coding-tutor",
"changelog-path": "../../CHANGELOG.md",
"extra-files": [
{
"type": "json",
"path": ".claude-plugin/plugin.json",
"jsonpath": "$.version"
},
{
"type": "json",
"path": ".cursor-plugin/plugin.json",
"jsonpath": "$.version"
}
]
},
".claude-plugin": {
"release-type": "simple",
"package-name": "marketplace",
"changelog-path": "../CHANGELOG.md",
"extra-files": [
{
"type": "json",
"path": "marketplace.json",
"jsonpath": "$.metadata.version"
}
]
}
}
}

View File

@@ -7,6 +7,31 @@ on:
workflow_dispatch:
jobs:
pr-title:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
pull-requests: read
steps:
- name: Validate PR title
uses: amannn/action-semantic-pull-request@v6.1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
requireScope: false
types: |
feat
fix
docs
refactor
chore
test
ci
build
perf
revert
test:
runs-on: ubuntu-latest
@@ -21,5 +46,8 @@ jobs:
- name: Install dependencies
run: bun install
- name: Validate release metadata
run: bun run release:validate
- name: Run tests
run: bun test

View File

@@ -1,47 +0,0 @@
name: Publish to npm
on:
push:
branches: [main]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
issues: write
pull-requests: write
concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run tests
run: bun test
- name: Setup Node.js for release
uses: actions/setup-node@v4
with:
# npm trusted publishing requires Node 22.14.0+.
node-version: "24"
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release

83
.github/workflows/release-pr.yml vendored Normal file
View File

@@ -0,0 +1,83 @@
name: Release PR
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
pull-requests: write
issues: write
concurrency:
group: release-pr-${{ github.ref }}
cancel-in-progress: false
jobs:
release-pr:
runs-on: ubuntu-latest
outputs:
cli_release_created: ${{ steps.release.outputs.release_created }}
cli_tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Validate release metadata scripts
run: bun run release:validate
- name: Maintain release PR
id: release
uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: .github/release-please-config.json
manifest-file: .github/.release-please-manifest.json
publish-cli:
needs: release-pr
if: needs.release-pr.outputs.cli_release_created == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
concurrency:
group: publish-${{ needs.release-pr.outputs.cli_tag_name }}
cancel-in-progress: false
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ needs.release-pr.outputs.cli_tag_name }}
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run tests
run: bun test
- name: Setup Node.js for release
uses: actions/setup-node@v4
with:
node-version: "24"
- name: Publish package
run: npm publish --provenance --access public

94
.github/workflows/release-preview.yml vendored Normal file
View File

@@ -0,0 +1,94 @@
name: Release Preview
on:
workflow_dispatch:
inputs:
title:
description: "Conventional title to evaluate (defaults to the latest commit title on this ref)"
required: false
type: string
cli_bump:
description: "CLI bump override"
required: false
type: choice
options: [auto, patch, minor, major]
default: auto
compound_engineering_bump:
description: "compound-engineering bump override"
required: false
type: choice
options: [auto, patch, minor, major]
default: auto
coding_tutor_bump:
description: "coding-tutor bump override"
required: false
type: choice
options: [auto, patch, minor, major]
default: auto
marketplace_bump:
description: "marketplace bump override"
required: false
type: choice
options: [auto, patch, minor, major]
default: auto
jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Determine title and changed files
id: inputs
shell: bash
run: |
TITLE="${{ github.event.inputs.title }}"
if [ -z "$TITLE" ]; then
TITLE="$(git log -1 --pretty=%s)"
fi
FILES="$(git diff --name-only HEAD~1...HEAD | tr '\n' ' ')"
echo "title=$TITLE" >> "$GITHUB_OUTPUT"
echo "files=$FILES" >> "$GITHUB_OUTPUT"
- name: Add preview note
run: |
echo "This preview currently evaluates the selected ref from its latest commit title and changed files." >> "$GITHUB_STEP_SUMMARY"
echo "It is side-effect free, but it does not yet reconstruct the full accumulated open release PR state." >> "$GITHUB_STEP_SUMMARY"
- name: Validate release metadata
run: bun run release:validate
- name: Preview release
shell: bash
run: |
TITLE='${{ steps.inputs.outputs.title }}'
FILES='${{ steps.inputs.outputs.files }}'
args=(--title "$TITLE" --json)
for file in $FILES; do
args+=(--file "$file")
done
args+=(--override "cli=${{ github.event.inputs.cli_bump || 'auto' }}")
args+=(--override "compound-engineering=${{ github.event.inputs.compound_engineering_bump || 'auto' }}")
args+=(--override "coding-tutor=${{ github.event.inputs.coding_tutor_bump || 'auto' }}")
args+=(--override "marketplace=${{ github.event.inputs.marketplace_bump || 'auto' }}")
bun run scripts/release/preview.ts "${args[@]}" | tee /tmp/release-preview.txt
- name: Publish preview summary
shell: bash
run: cat /tmp/release-preview.txt >> "$GITHUB_STEP_SUMMARY"