Skip to content

feat: action menu

feat: action menu #49

name: Publish canary release
on:
workflow_dispatch:
inputs:
dry_run:
description: 'Run in dry-run mode (no actual publishing or git commits)'
required: false
default: false
type: boolean
pull_request:
branches: [canary]
jobs:
publish-canary:
permissions:
contents: write
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version-file: "package.json"
- name: Setup Node.js for npm
uses: actions/setup-node@v4
with:
node-version-file: "package.json"
- name: Install dependencies
run: bun i --frozen-lockfile
- name: Set up .npmrc for authentication
if: github.event_name != 'pull_request' && !inputs.dry_run
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Build and publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd packages/filters
bun run build
if [[ "${{ github.event_name }}" == "pull_request" ]] || [[ "${{ inputs.dry_run }}" == "true" ]]; then
bun run release:patch:canary --no-git-tag --dry-run
else
bun run release:patch:canary --no-git-tag
fi
- name: Commit version changes
if: github.event_name != 'pull_request' && !inputs.dry_run
run: |
NEXT_VERSION="v$(cat packages/filters/package.json | jq ".version" -r)"
git add packages/filters/package.json
git commit --amend --no-edit --no-verify
git tag $NEXT_VERSION
git push origin HEAD --force-with-lease --no-verify
git push origin $NEXT_VERSION --no-verify