11name : Release
22
33on :
4- schedule :
5- - cron : ' 0 8 * * 1' # Every Monday at 08:00 UTC
6- workflow_dispatch :
4+ push :
5+ branches :
6+ - main
7+
8+ permissions :
9+ contents : write
10+ issues : write
11+ pull-requests : write
712
813concurrency :
914 group : release
1015 cancel-in-progress : false
1116
12- permissions :
13- contents : write
14-
1517jobs :
18+ test :
19+ name : Test
20+ runs-on : ubuntu-latest
21+ steps :
22+ - name : Checkout
23+ uses : actions/checkout@v5
24+
25+ - name : Setup Node
26+ uses : actions/setup-node@v4
27+ with :
28+ cache : npm
29+
30+ - name : Install dependencies
31+ run : npm ci
32+
33+ - name : Compile
34+ run : npx vsce package
35+ env :
36+ LOCALSTACK_WEB_AUTH_REDIRECT : https://app.localstack.cloud/redirect
37+ NODE_ENV : ci
38+
39+ - name : Test
40+ run : xvfb-run -a npx vscode-test
41+
1642 release :
1743 name : Release
1844 runs-on : ubuntu-latest
45+ needs : test
46+ outputs :
47+ release_created : ${{ steps.release.outputs.release_created }}
48+ tag_name : ${{ steps.release.outputs.tag_name }}
49+ version : ${{ steps.release.outputs.version }}
50+ steps :
51+ - uses : googleapis/release-please-action@v4
52+ id : release
53+ with :
54+ token : ${{ secrets.GITHUB_TOKEN }}
55+ release-type : node
1956
57+ build :
58+ name : Build
59+ runs-on : ubuntu-latest
60+ needs : release
61+ if : ${{ needs.release.outputs.release_created == 'true' }}
2062 steps :
2163 - name : Checkout
2264 uses : actions/checkout@v5
23- with :
24- fetch-depth : 0
25- token : ${{ secrets.GITHUB_TOKEN }}
2665
2766 - name : Setup Node
2867 uses : actions/setup-node@v4
@@ -32,19 +71,72 @@ jobs:
3271 - name : Install dependencies
3372 run : npm ci
3473
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
74+ - name : Build VSIX
75+ run : npx vsce package
76+ env :
77+ LOCALSTACK_WEB_AUTH_REDIRECT : https://app.localstack.cloud/redirect
78+ NODE_ENV : production
79+ ANALYTICS_API_URL : https://analytics.localstack.cloud/v1/events
80+
81+ - name : Upload VSIX artifact
82+ uses : actions/upload-artifact@v4
83+ with :
84+ name : vsix
85+ path : " *.vsix"
86+
87+ publish-github-release-artifact :
88+ name : Publish artifact to GitHub Release
89+ runs-on : ubuntu-latest
90+ needs : [build, release]
91+ if : ${{ needs.release.outputs.release_created == 'true' }}
92+ steps :
93+ - name : Download VSIX
94+ uses : actions/download-artifact@v4
95+ with :
96+ name : vsix
97+
98+ - name : Setup Node
99+ uses : actions/setup-node@v4
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