File tree Expand file tree Collapse file tree 3 files changed +3958
-2
lines changed Expand file tree Collapse file tree 3 files changed +3958
-2
lines changed Original file line number Diff line number Diff line change 1+ name : Release Extension
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+
8+ jobs :
9+ release :
10+ runs-on : ubuntu-latest
11+ permissions :
12+ contents : write
13+
14+ steps :
15+ - name : Checkout code
16+ uses : actions/checkout@v4
17+
18+ - name : Setup Node.js
19+ uses : actions/setup-node@v4
20+ with :
21+ node-version : ' 20'
22+ cache : ' npm'
23+
24+ - name : Install dependencies
25+ run : npm install
26+
27+ - name : Get version from tag
28+ id : get_version
29+ run : echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
30+
31+ - name : Verify version matches package.json
32+ run : |
33+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
34+ TAG_VERSION="${{ steps.get_version.outputs.VERSION }}"
35+ if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then
36+ echo "Error: package.json version ($PACKAGE_VERSION) does not match tag version ($TAG_VERSION)"
37+ exit 1
38+ fi
39+
40+ - name : Package extension
41+ run : npx vsce package
42+
43+ - name : Publish to VS Code Marketplace
44+ run : npx vsce publish
45+ env :
46+ VSCE_PAT : ${{ secrets.MARKETPLACE_TOKEN }}
47+
48+ - name : Create GitHub Release
49+ run : |
50+ gh release create ${{ github.ref_name }} \
51+ --title "Release ${{ github.ref_name }}" \
52+ --generate-notes \
53+ *.vsix
54+ env :
55+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments