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
3 changes: 3 additions & 0 deletions .auto-release-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.7"
}
80 changes: 80 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Auto Release

# On every push to `main`:
# 1. Open (or update) a release PR that bumps package.json + CHANGELOG.md
# from conventional-commit messages since the last release.
# 2. When that release PR is merged (which lands a release commit on main),
# create the matching vX.Y.Z tag AND inline-publish to npm + create a
# GitHub Release.
#
# Why inline publish: workflow runs initiated via GITHUB_TOKEN do not
# trigger other workflows (GitHub's anti-recursion rule). So a release-PR
# merge tagging vX.Y.Z would NOT fire the existing tag-triggered
# release.yml. Running publish here, gated on release_created, avoids
# needing a PAT or GitHub App token.

on:
push:
branches: [main]

permissions:
contents: write
pull-requests: write
id-token: write

jobs:
auto-release:
runs-on: ubuntu-latest
steps:
- id: release
uses: googleapis/release-please-action@v4
with:
config-file: auto-release-config.json
manifest-file: .auto-release-manifest.json

# Only the steps below run when this push *was* the release-PR merge
# that landed the version bump. For ordinary feature merges,
# release_created is false and the job ends here.

- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}

- name: Setup Bun
if: ${{ steps.release.outputs.release_created }}
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Setup Node
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org

- name: Install
if: ${{ steps.release.outputs.release_created }}
run: bun install --frozen-lockfile

- name: Type Check
if: ${{ steps.release.outputs.release_created }}
run: bun run check

- name: Build
if: ${{ steps.release.outputs.release_created }}
run: bun run build

- name: Verify CLI Version Matches package.json
if: ${{ steps.release.outputs.release_created }}
run: |
cli_version="$(bun dist/index.js --version)"
pkg_version="$(node -p "require('./package.json').version")"
if [ "$cli_version" != "$pkg_version" ]; then
echo "Version mismatch: cli=$cli_version package=$pkg_version"
exit 1
fi
echo "Version OK: $cli_version"

- name: Publish to npm
if: ${{ steps.release.outputs.release_created }}
run: npm publish --cache /tmp/npm-cache
16 changes: 16 additions & 0 deletions auto-release-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"release-type": "node",
"include-component-in-tag": false,
"include-v-in-tag": true,
"bootstrap-sha": "80a8f04",
"packages": {
".": {
"release-type": "node",
"package-name": "bluebubbles-cli",
"changelog-path": "CHANGELOG.md",
"draft": false,
"prerelease": false
}
}
}
Loading