feat: migrate repo releases to manual release-please (#293)
This commit is contained in:
28
.github/workflows/ci.yml
vendored
28
.github/workflows/ci.yml
vendored
@@ -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
|
||||
|
||||
47
.github/workflows/publish.yml
vendored
47
.github/workflows/publish.yml
vendored
@@ -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
83
.github/workflows/release-pr.yml
vendored
Normal 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
94
.github/workflows/release-preview.yml
vendored
Normal 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"
|
||||
Reference in New Issue
Block a user