Skip to content

Commit 4efeeb9

Browse files
committed
Move GitHub release and marketplace publish to CI; Add retag script
1 parent e6c80c4 commit 4efeeb9

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,21 @@ jobs:
2424
needs: test
2525
if: startsWith(github.ref, 'refs/tags/v')
2626
runs-on: ubuntu-latest
27+
permissions:
28+
contents: write
2729
steps:
2830
- uses: actions/checkout@v6
2931
- uses: actions/setup-node@v6
3032
with:
3133
node-version: 22
3234
- run: npm ci
35+
- run: npm run package
36+
- name: Create or update GitHub release
37+
run: |
38+
gh release create "$GITHUB_REF_NAME" git-crypt-vscode-*.vsix --title "$GITHUB_REF_NAME" --generate-notes ||
39+
gh release upload "$GITHUB_REF_NAME" git-crypt-vscode-*.vsix --clobber
40+
env:
41+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3342
- run: npm run publish
3443
env:
3544
VSCE_PAT: ${{ secrets.VSCE_PAT }}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
},
5959
"scripts": {
6060
"preversion": "npm run build && npm test",
61-
"postversion": "git push origin main v$npm_package_version && npm run release",
62-
"release": "npm run package && gh release create v$npm_package_version git-crypt-vscode-$npm_package_version.vsix --title v$npm_package_version --generate-notes",
61+
"postversion": "git push origin main v$npm_package_version",
62+
"retag": "git tag -f v$npm_package_version && git push origin v$npm_package_version --force",
6363
"vscode:prepublish": "npm run build",
6464
"build": "node esbuild.js",
6565
"watch": "node esbuild.js --watch",

0 commit comments

Comments
 (0)