1- name : Release
2-
31on :
4- schedule :
5- - cron : ' 0 8 * * 1' # Every Monday at 08:00 UTC
6- workflow_dispatch :
7-
8- concurrency :
9- group : release
10- cancel-in-progress : false
2+ push :
3+ branches :
4+ - main
115
126permissions :
137 contents : write
8+ issues : write
9+ pull-requests : write
10+
11+ name : release
1412
1513jobs :
16- release :
17- name : Release
14+ test :
15+ name : Test
1816 runs-on : ubuntu-latest
19-
2017 steps :
2118 - name : Checkout
2219 uses : actions/checkout@v5
20+
21+ - name : Setup Node
22+ uses : actions/setup-node@v4
23+ with :
24+ cache : npm
25+
26+ - name : Install dependencies
27+ run : npm ci
28+
29+ - name : Compile
30+ run : npx vsce package
31+ env :
32+ LOCALSTACK_WEB_AUTH_REDIRECT : https://app.localstack.cloud/redirect
33+ NODE_ENV : ci
34+
35+ - name : Test
36+ run : xvfb-run -a npx vscode-test
37+
38+ release :
39+ runs-on : ubuntu-latest
40+ needs : test
41+ outputs :
42+ release_created : ${{ steps.release.outputs.release_created }}
43+ tag_name : ${{ steps.release.outputs.tag_name }}
44+ version : ${{ steps.release.outputs.version }}
45+ steps :
46+ - uses : googleapis/release-please-action@v4
47+ id : release
2348 with :
24- fetch-depth : 0
2549 token : ${{ secrets.GITHUB_TOKEN }}
50+ release-type : node
51+
52+ build :
53+ name : Build
54+ runs-on : ubuntu-latest
55+ needs : release
56+ if : ${{ needs.release.outputs.release_created == 'true' }}
57+ steps :
58+ - name : Checkout
59+ uses : actions/checkout@v5
2660
2761 - name : Setup Node
2862 uses : actions/setup-node@v4
@@ -32,19 +66,77 @@ jobs:
3266 - name : Install dependencies
3367 run : npm ci
3468
35- - name : Configure git
36- run : |
37- git config user.name "github-actions[bot]"
38- git config user.email "github-actions[bot]@users.noreply.github.com"
39-
40- - name : Bump version, update changelog, and tag
41- run : |
42- BEFORE=$(node -p "require('./package.json').version")
43- npx --yes commit-and-tag-version
44- AFTER=$(node -p "require('./package.json').version")
45-
46- if [ "$BEFORE" != "$AFTER" ]; then
47- git push --follow-tags origin main
48- else
49- echo "No releasable commits — skipping push"
50- fi
69+ - name : Build VSIX
70+ run : npx vsce package
71+ env :
72+ LOCALSTACK_WEB_AUTH_REDIRECT : https://app.localstack.cloud/redirect
73+ NODE_ENV : production
74+ ANALYTICS_API_URL : https://analytics.localstack.cloud/v1/events
75+
76+ - name : Upload VSIX artifact
77+ uses : actions/upload-artifact@v4
78+ with :
79+ name : vsix
80+ path : " *.vsix"
81+
82+ publish-github-release-artifact :
83+ name : Publish artifact to GitHub Release
84+ runs-on : ubuntu-latest
85+ needs : [build, release]
86+ if : ${{ needs.release.outputs.release_created == 'true' }}
87+ steps :
88+ - name : Download VSIX
89+ uses : actions/download-artifact@v4
90+ with :
91+ name : vsix
92+
93+ - name : Setup Node
94+ uses : actions/setup-node@v4
95+
96+ - name : Publish to VS Marketplace
97+ run : npx @vscode/vsce publish --packagePath *.vsix
98+ env :
99+ VSCE_PAT : ${{ secrets.VSCE_PAT }}
100+
101+ - name : Upload Release Artifact
102+ env :
103+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
104+ run : gh release upload ${{ needs.release.outputs.tag_name }} *.vsix
105+
106+ publish-vscode-marketplace :
107+ name : Publish to VS Marketplace
108+ runs-on : ubuntu-latest
109+ needs : [build, release]
110+ if : ${{ needs.release.outputs.release_created == 'true' }}
111+ steps :
112+ - name : Download VSIX
113+ uses : actions/download-artifact@v4
114+ with :
115+ name : vsix
116+
117+ - name : Setup Node
118+ uses : actions/setup-node@v4
119+
120+ - name : Publish to VS Marketplace
121+ run : npx @vscode/vsce publish --packagePath *.vsix
122+ env :
123+ VSCE_PAT : ${{ secrets.VSCE_PAT }}
124+
125+ publish-ovsx :
126+ name : Publish to Open VSX
127+ runs-on : ubuntu-latest
128+ needs : [build, release]
129+ if : ${{ needs.release.outputs.release_created == 'true' }}
130+ steps :
131+ - name : Download VSIX
132+ uses : actions/download-artifact@v4
133+ with :
134+ name : vsix
135+
136+ - name : Setup Node
137+ uses : actions/setup-node@v4
138+
139+ - name : Publish to Open VSX
140+ run : npx ovsx publish *.vsix -p $OVSX_PAT
141+ env :
142+ OVSX_PAT : ${{ secrets.OVSX_PAT }}
0 commit comments