File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,13 @@ name: Publish to npm
33on :
44 workflow_dispatch :
55 inputs :
6+ branch :
7+ description : ' Branch to publish from'
8+ type : choice
9+ options :
10+ - main
11+ - dev
12+ default : main
613 dry_run :
714 description : ' Dry run — show what would be published without actually publishing'
815 type : boolean
2330 steps :
2431 - name : Checkout
2532 uses : actions/checkout@v4
33+ with :
34+ ref : ${{ inputs.branch }}
2635
2736 - name : Setup pnpm
2837 uses : pnpm/action-setup@v4
4655 run : |
4756 PKG_VERSION=$(node -p "require('./package.json').version")
4857 REF_TYPE="${{ github.ref_type }}"
49- BRANCH="${{ github.ref_name }}"
58+ BRANCH="${{ inputs.branch }}"
5059
5160 if [[ "$REF_TYPE" == "tag" ]]; then
5261 # Explicit tag (e.g. v1.2.3 or v1.2.3-rc.1) — always publish as latest
6675 echo "channel=stable" >> $GITHUB_OUTPUT
6776 fi
6877
69- elif [[ "$BRANCH" == "beta" || "$BRANCH" == "next" ]]; then
78+ elif [[ "$BRANCH" == "dev" || "$BRANCH" == " beta" || "$BRANCH" == "next" ]]; then
7079 # Pre-release branches — append date + short SHA so every commit gets a unique version
7180 SHORT_SHA=$(git rev-parse --short=7 HEAD)
7281 DATE=$(date -u +%Y%m%d)
You can’t perform that action at this time.
0 commit comments