66 workflow_dispatch :
77
88env :
9- VSCODE_EXT_PATH : apps/vscode-extension
9+ MS_URL : " https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-demo-time"
10+ VSX_URL : " https://open-vsx.org/extension/eliostruyf/vscode-demo-time"
1011
1112jobs :
1213 verify :
@@ -15,40 +16,70 @@ jobs:
1516
1617 steps :
1718 - uses : actions/checkout@v4
19+
20+ - name : Enable Corepack
21+ run : corepack enable
22+
1823 - uses : actions/setup-node@v4
1924 with :
2025 node-version : 20
26+ cache : " yarn"
2127
22- - name : Install the dependencies
23- run : npm i
28+ - name : Install dependencies
29+ run : yarn install --immutable
2430
2531 - name : Verify actions
2632 run : node .github/scripts/verify-actions.mjs
2733
28- build :
29- name : ' Build and release'
30- runs-on : ubuntu-latest
34+ build-and-test :
3135 needs : verify
36+ uses : ./.github/workflows/release-common.yml
37+ with :
38+ build_command : npm run vscode:build
39+ lint_command : npm run lint
40+ test_command : npm run test
41+ prepare_beta_command : " "
42+ working_directory : apps/vscode-extension
3243
33- defaults :
34- run :
35- working-directory : ${{ env.VSCODE_EXT_PATH }}
44+ release-ms :
45+ name : " Release to VSCode Marketplace"
46+ runs-on : ubuntu-latest
47+ needs : build-and-test
48+ environment :
49+ name : " Microsoft Marketplace"
50+ url : ${{ env.MS_URL }}
3651
3752 steps :
3853 - uses : actions/checkout@v4
39- - uses : actions/setup-node@v4
40- with :
41- node-version : 20
42- registry-url : https://registry.npmjs.org/
4354
44- - name : Install the dependencies
45- run : npm ci
46-
47- - name : Linting and testing
48- run : npm run lint && npm test
55+ - name : Download build artifacts
56+ uses : actions/download-artifact@v4
57+ with :
58+ name : vscode-extension-build
59+ path : apps/vscode-extension
4960
5061 - name : Publish
5162 run : npx @vscode/vsce publish -p ${{ secrets.VSCE_PAT }} --no-dependencies
63+ working-directory : apps/vscode-extension
64+
65+ release-vsx :
66+ name : " Release to Open VSX"
67+ runs-on : ubuntu-latest
68+ needs : build-and-test
69+
70+ environment :
71+ name : " Open VSX"
72+ url : ${{ env.VSX_URL }}
73+
74+ steps :
75+ - uses : actions/checkout@v4
76+
77+ - name : Download build artifacts
78+ uses : actions/download-artifact@v4
79+ with :
80+ name : vscode-extension-build
81+ path : apps/vscode-extension
5282
5383 - name : Publish to open-vsx.org
5484 run : npx ovsx publish -p ${{ secrets.OPEN_VSX_PAT }} --no-dependencies
85+ working-directory : apps/vscode-extension
0 commit comments