11name : Publish VS Code Extension
22
33on :
4+ release :
5+ types : [published]
6+
47 workflow_dispatch :
58
69permissions :
7- contents : write
10+ contents : read
811
912jobs :
1013 build :
1114 name : Build & Package VSIX
1215 runs-on : ubuntu-latest
16+ permissions :
17+ contents : read
1318
1419 steps :
1520 - name : Checkout repository
1621 uses : actions/checkout@v4
1722
18- - name : Install Node.js
23+ - name : Use Node.js 20
1924 uses : actions/setup-node@v4
2025 with :
2126 node-version : 20
@@ -26,58 +31,64 @@ jobs:
2631 - name : Compile TypeScript
2732 run : npm run compile
2833
29- - name : Install vsce
34+ - name : Install vsce CLI
3035 run : npm install -g @vscode/vsce
3136
3237 - name : Create VSIX package
33- run : vsce package
38+ run : vsce package --no-yarn
3439
3540 - name : Upload VSIX artifact
3641 uses : actions/upload-artifact@v4
3742 with :
3843 name : extension
3944 path : " *.vsix"
4045
41- release :
46+ attach- release :
4247 name : Attach VSIX to GitHub Release
4348 needs : build
4449 runs-on : ubuntu-latest
4550 permissions :
4651 contents : write
52+ if : github.event_name == 'release'
4753
4854 steps :
4955 - name : Download VSIX artifact
5056 uses : actions/download-artifact@v4
5157 with :
5258 name : extension
5359
54- - name : Create GitHub Release
55- uses : softprops/action-gh-release@v1
60+ - name : Upload VSIX to GitHub Release
61+ uses : softprops/action-gh-release@v2
5662 with :
5763 files : " *.vsix"
5864 env :
5965 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6066
6167 publish :
6268 name : Publish to VS Code Marketplace
63- needs : release
69+ needs : build
6470 runs-on : ubuntu-latest
71+ permissions :
72+ contents : read
6573
6674 steps :
67- - name : Install Node.js
75+ - name : Checkout repository
76+ uses : actions/checkout@v4
77+
78+ - name : Use Node.js 20
6879 uses : actions/setup-node@v4
6980 with :
7081 node-version : 20
7182
72- - name : Install vsce
83+ - name : Install vsce CLI
7384 run : npm install -g @vscode/vsce
7485
7586 - name : Download VSIX artifact
7687 uses : actions/download-artifact@v4
7788 with :
7889 name : extension
7990
80- - name : Publish to VSCode Marketplace
91+ - name : Publish to VS Code Marketplace
8192 run : vsce publish --packagePath *.vsix
8293 env :
8394 VSCE_PAT : ${{ secrets.VSCE_PAT }}
0 commit comments