Skip to content
Merged
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
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release

on:
push:
tags: ["v*"]
workflow_dispatch:

permissions:
contents: write

jobs:
release:
name: Build and Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: pnpm/action-setup@v6
with:
version: 10

- uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm

- run: pnpm install --frozen-lockfile

- name: Verify tag matches version
if: startsWith(github.ref, 'refs/tags/v')
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
PKG_VERSION=$(node -p "require('./package.json').version")
MANIFEST_VERSION=$(node -p "require('./static/manifest.json').version")
[ "$TAG_VERSION" = "$PKG_VERSION" ] || { echo "Tag $TAG_VERSION != package.json $PKG_VERSION"; exit 1; }
[ "$TAG_VERSION" = "$MANIFEST_VERSION" ] || { echo "Tag $TAG_VERSION != manifest.json $MANIFEST_VERSION"; exit 1; }

- name: Build and package
run: pnpm run pack

- name: Stage release asset
run: |
VERSION=$(node -p "require('./package.json').version")
mv better-github.zip "better-github-v${VERSION}.zip"

- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: better-github-v*.zip