Skip to content

Commit f6cfcb5

Browse files
committed
Add workflow_dispatch for dry-run builds
Allows manually triggering the full build + package + verify pipeline from the Actions tab without publishing to marketplace or creating a GitHub release. Tag-only steps are gated with step-level conditionals.
1 parent cfeb6c0 commit f6cfcb5

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
tags: [v*]
77
pull_request:
88
branches: [main]
9+
workflow_dispatch:
910

1011
jobs:
1112
test:
@@ -21,7 +22,7 @@ jobs:
2122
- run: npm test
2223

2324
build-git-crypt:
24-
if: startsWith(github.ref, 'refs/tags/v')
25+
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
2526
strategy:
2627
matrix:
2728
include:
@@ -94,7 +95,7 @@ jobs:
9495

9596
publish:
9697
needs: [test, build-git-crypt]
97-
if: startsWith(github.ref, 'refs/tags/v')
98+
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
9899
runs-on: ubuntu-latest
99100
permissions:
100101
contents: write
@@ -103,6 +104,7 @@ jobs:
103104
with:
104105
fetch-depth: 0
105106
- name: Verify tag is on main
107+
if: startsWith(github.ref, 'refs/tags/v')
106108
run: |
107109
if ! git branch -r --contains "$GITHUB_SHA" | grep -q 'origin/main'; then
108110
echo "Error: tag $GITHUB_REF_NAME is not on the main branch"
@@ -113,6 +115,7 @@ jobs:
113115
node-version: 22
114116
- run: npm ci
115117
- name: Verify tag matches package.json version
118+
if: startsWith(github.ref, 'refs/tags/v')
116119
run: |
117120
PKG_VERSION="v$(node -p 'require("./package.json").version')"
118121
if [ "$PKG_VERSION" != "$GITHUB_REF_NAME" ]; then
@@ -149,13 +152,15 @@ jobs:
149152
npx vsce ls --packagePath "$UNIVERSAL" | grep -c 'bin/git-crypt' | xargs -I{} test {} -eq 0
150153
151154
- name: Create or update GitHub release
155+
if: startsWith(github.ref, 'refs/tags/v')
152156
run: |
153157
gh release create "$GITHUB_REF_NAME" git-crypt-vscode-*.vsix --title "$GITHUB_REF_NAME" --generate-notes ||
154158
gh release upload "$GITHUB_REF_NAME" git-crypt-vscode-*.vsix --clobber
155159
env:
156160
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157161

158162
- name: Publish to marketplace
163+
if: startsWith(github.ref, 'refs/tags/v')
159164
run: npx vsce publish --packagePath git-crypt-vscode-*.vsix
160165
env:
161166
VSCE_PAT: ${{ secrets.VSCE_PAT }}

0 commit comments

Comments
 (0)