1+ name : Release VSCode Extension
2+ on :
3+ push :
4+ tags :
5+ - ' vscode@v*'
6+ jobs :
7+ release :
8+ runs-on : ubuntu-latest
9+ permissions :
10+ contents : write
11+ steps :
12+ - name : Checkout repository
13+ uses : actions/checkout@v4
14+ - name : Setup Node.js
15+ uses : actions/setup-node@v4
16+ with :
17+ node-version : ' 20'
18+ - name : Install pnpm
19+ uses : pnpm/action-setup@v2
20+ with :
21+ version : 10
22+ - name : Install dependencies
23+ run : pnpm install --frozen-lockfile
24+ - name : Extract version from tag
25+ id : extract_version
26+ run : |
27+ VERSION=${GITHUB_REF#refs/tags/vscode@v}
28+ echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
29+ - name : Update package.json version
30+ working-directory : vscode/extension
31+ run : |
32+ npm version ${{ steps.extract_version.outputs.VERSION }} --no-git-tag-version
33+ - name : Build extension
34+ working-directory : vscode/extension
35+ run : pnpm run compile
36+ - name : Package extension
37+ working-directory : vscode/extension
38+ run : |
39+ pnpm run vscode:package
40+ # Rename the output file to include the version
41+ mv *.vsix sqlmesh-${{ steps.extract_version.outputs.VERSION }}.vsix
42+ - name : Create Release
43+ id : create_release
44+ uses : actions/create-release@v1
45+ env :
46+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
47+ with :
48+ tag_name : ${{ github.ref }}
49+ release_name : VSCode Extension v${{ steps.extract_version.outputs.VERSION }}
50+ body : |
51+ ## SQLMesh VSCode Extension v${{ steps.extract_version.outputs.VERSION }}
52+ draft : false
53+ prerelease : false
54+ - name : Upload Extension to Release
55+ uses : actions/upload-release-asset@v1
56+ env :
57+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
58+ with :
59+ upload_url : ${{ steps.create_release.outputs.upload_url }}
60+ asset_path : vscode/extension/sqlmesh-${{ steps.extract_version.outputs.VERSION }}.vsix
61+ asset_name : sqlmesh-${{ steps.extract_version.outputs.VERSION }}.vsix
62+ asset_content_type : application/octet-stream
0 commit comments