Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions .github/workflows/release_extension.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
name: Release VSCode Extension
on:
push:
tags:
- 'vscode@v*'
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., 1.0.0)'
required: true
type: string
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check branch is main
run: |
if [[ "${{ github.ref }}" != "refs/heads/main" ]]; then
echo "Error: This workflow can only be run from the main branch"
Comment thread
benfdking marked this conversation as resolved.
exit 1
fi
echo "Branch check passed: running from main branch"
- name: Validate version format
run: |
version="${{ github.event.inputs.version }}"
if ! [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$ ]]; then
echo "Error: Version must be a valid semantic version (e.g., 1.0.0, 1.0.0-beta.1, 1.0.0+build.1)"
exit 1
fi
echo "Version format is valid: $version"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -19,25 +37,20 @@ jobs:
version: 10
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Extract version from tag
id: extract_version
run: |
VERSION=${GITHUB_REF#refs/tags/vscode@v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Update package.json version
working-directory: vscode/extension
run: |
npm version ${{ steps.extract_version.outputs.VERSION }} --no-git-tag-version
npm version ${{ github.event.inputs.version }} --no-git-tag-version
- name: Build extension
working-directory: vscode/extension
run: pnpm run vscode:package
- name: Upload extension to Marketplace
working-directory: vscode/extension
run: |
pnpx vsce publish --packagePath sqlmesh-${{ steps.extract_version.outputs.VERSION }}.vsix
pnpx vsce publish --packagePath sqlmesh-${{ github.event.inputs.version }}.vsix
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Upload extension to OpenVSX
working-directory: vscode/extension
run: |
pnpx ovsx publish -p ${{ secrets.OPEN_VSX_TOKEN }} sqlmesh-${{ steps.extract_version.outputs.VERSION }}.vsix
pnpx ovsx publish -p ${{ secrets.OPEN_VSX_TOKEN }} sqlmesh-${{ github.event.inputs.version }}.vsix