Skip to content

Commit c60adcd

Browse files
authored
ci: fix canary release workflow (#174)
1 parent 245019e commit c60adcd

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

.github/workflows/publish-canary-release.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
name: Publish canary release
2+
23
on:
34
workflow_dispatch:
5+
inputs:
6+
dry_run:
7+
description: 'Run in dry-run mode (no actual publishing or git commits)'
8+
required: false
9+
default: false
10+
type: boolean
411
pull_request:
5-
branches: ['abc/**']
6-
# push:
7-
# branches: [canary]
8-
# paths: ['packages/filters/**']
12+
branches: [canary]
913

1014
jobs:
1115
publish-canary:
@@ -38,6 +42,7 @@ jobs:
3842
run: bun i --frozen-lockfile
3943

4044
- name: Set up .npmrc for authentication
45+
if: github.event_name != 'pull_request' && !inputs.dry_run
4146
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
4247
env:
4348
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -48,9 +53,14 @@ jobs:
4853
run: |
4954
cd packages/filters
5055
bun run build
51-
bun run release:patch:canary --no-git-tag
56+
if [[ "${{ github.event_name }}" == "pull_request" ]] || [[ "${{ inputs.dry_run }}" == "true" ]]; then
57+
bun run release:patch:canary --no-git-tag --dry-run
58+
else
59+
bun run release:patch:canary --no-git-tag
60+
fi
5261
5362
- name: Commit version changes
63+
if: github.event_name != 'pull_request' && !inputs.dry_run
5464
run: |
5565
NEXT_VERSION="v$(cat packages/filters/package.json | jq ".version" -r)"
5666
git add packages/filters/package.json

0 commit comments

Comments
 (0)