Skip to content

Commit 17e12ce

Browse files
author
Clawd
committed
ci: add manual workflow dispatch with release option
- workflow_dispatch inputs: - release_tag: specify version to release (e.g., v0.1.0) - skip_tests: skip test jobs for faster iteration - Release/publish now work with manual trigger + release_tag input
1 parent 255c3aa commit 17e12ce

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

.github/workflows/build-nodejs.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ on:
88
pull_request:
99
branches: [master, main]
1010
workflow_dispatch:
11+
inputs:
12+
release_tag:
13+
description: 'Release tag (e.g., v0.1.0) - triggers release + publish'
14+
required: false
15+
type: string
16+
skip_tests:
17+
description: 'Skip test jobs'
18+
required: false
19+
type: boolean
20+
default: false
1121

1222
env:
1323
CARGO_TERM_COLOR: always
@@ -137,6 +147,7 @@ jobs:
137147

138148
# Test the builds
139149
test:
150+
if: ${{ !inputs.skip_tests }}
140151
needs: build
141152
strategy:
142153
fail-fast: false
@@ -180,7 +191,7 @@ jobs:
180191
181192
# Create release on tag
182193
release:
183-
if: startsWith(github.ref, 'refs/tags/v')
194+
if: ${{ always() && !cancelled() && !failure() && (startsWith(github.ref, 'refs/tags/v') || inputs.release_tag != '') }}
184195
needs: [build, universal-macos, test]
185196
runs-on: ubuntu-latest
186197
name: Create Release
@@ -215,16 +226,17 @@ jobs:
215226
# softprops/action-gh-release@v2
216227
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b
217228
with:
229+
tag_name: ${{ inputs.release_tag || github.ref_name }}
218230
files: release/*
219231
generate_release_notes: true
220232
draft: false
221-
prerelease: ${{ contains(github.ref, '-') }}
233+
prerelease: ${{ contains(inputs.release_tag || github.ref, '-') }}
222234
env:
223235
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
224236

225237
# Optional: Publish to npm
226238
publish:
227-
if: startsWith(github.ref, 'refs/tags/v')
239+
if: ${{ startsWith(github.ref, 'refs/tags/v') || inputs.release_tag != '' }}
228240
needs: [release]
229241
runs-on: ubuntu-latest
230242
name: Publish to npm

0 commit comments

Comments
 (0)