Skip to content

Commit 49ea64e

Browse files
committed
ci: make release vscode manual step
1 parent 570274c commit 49ea64e

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed
Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,32 @@
11
name: Release VSCode Extension
22
on:
3-
push:
4-
tags:
5-
- 'vscode@v*'
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'Version to release (e.g., 1.0.0)'
7+
required: true
8+
type: string
69
jobs:
710
release:
811
runs-on: ubuntu-latest
912
steps:
1013
- name: Checkout repository
1114
uses: actions/checkout@v4
15+
- name: Check branch is main
16+
run: |
17+
if [[ "${{ github.ref }}" != "refs/heads/main" ]]; then
18+
echo "Error: This workflow can only be run from the main branch"
19+
exit 1
20+
fi
21+
echo "Branch check passed: running from main branch"
22+
- name: Validate version format
23+
run: |
24+
version="${{ github.event.inputs.version }}"
25+
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
26+
echo "Error: Version must be a valid semantic version (e.g., 1.0.0, 1.0.0-beta.1, 1.0.0+build.1)"
27+
exit 1
28+
fi
29+
echo "Version format is valid: $version"
1230
- name: Setup Node.js
1331
uses: actions/setup-node@v4
1432
with:
@@ -19,15 +37,10 @@ jobs:
1937
version: 10
2038
- name: Install dependencies
2139
run: pnpm install --frozen-lockfile
22-
- name: Extract version from tag
23-
id: extract_version
24-
run: |
25-
VERSION=${GITHUB_REF#refs/tags/vscode@v}
26-
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
2740
- name: Update package.json version
2841
working-directory: vscode/extension
2942
run: |
30-
npm version ${{ steps.extract_version.outputs.VERSION }} --no-git-tag-version
43+
npm version ${{ github.event.inputs.version }} --no-git-tag-version
3144
- name: Install dependencies
3245
working-directory: vscode/extension
3346
run: pnpm install
@@ -39,6 +52,6 @@ jobs:
3952
- name: Upload extension to Marketplace
4053
working-directory: vscode/extension
4154
run: |
42-
pnpx vsce publish --packagePath sqlmesh-${{ steps.extract_version.outputs.VERSION }}.vsix
55+
pnpx vsce publish --packagePath sqlmesh-${{ github.event.inputs.version }}.vsix
4356
env:
4457
VSCE_PAT: ${{ secrets.VSCE_PAT }}

0 commit comments

Comments
 (0)