66 tags : [v*]
77 pull_request :
88 branches : [main]
9+ workflow_dispatch :
910
1011jobs :
1112 test :
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 :
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