Skip to content

Commit 62f5a81

Browse files
authored
Merge pull request MayDay-wpf#18 from zfb132/main
ci(vsix): add workflows for building vscode extension
2 parents 29f2335 + 53d3ca1 commit 62f5a81

8 files changed

Lines changed: 107 additions & 25 deletions

File tree

.github/workflows/build_vsix.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Build VSIX Package
2+
3+
on:
4+
push:
5+
paths:
6+
- '.github/workflows/build_vsix.yml'
7+
- 'VSIX/**'
8+
- 'VSIX/**.vsix'
9+
- '!VSIX/**.md'
10+
- '!VSIX/LICENSE'
11+
- '!VSIX/.vscodeignore'
12+
branches:
13+
- '*'
14+
tags:
15+
- 'v*'
16+
workflow_dispatch:
17+
inputs:
18+
version:
19+
description: 'Version to publish (e.g., 1.0.0)'
20+
required: true
21+
type: string
22+
23+
permissions:
24+
contents: write
25+
packages: write
26+
27+
jobs:
28+
publish:
29+
runs-on: ubuntu-latest
30+
defaults:
31+
run:
32+
working-directory: VSIX
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v6
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v6
39+
with:
40+
node-version: '20'
41+
registry-url: 'https://registry.npmjs.org/'
42+
43+
- name: Update version (manual trigger)
44+
if: github.event_name == 'workflow_dispatch'
45+
run: npm version ${{ github.event.inputs.version }} --no-git-tag-version
46+
47+
- name: Get package version
48+
run: |
49+
echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
50+
51+
- name: Install dependencies
52+
run: npm install
53+
54+
- name: Build project
55+
run: npx -y @vscode/vsce package
56+
57+
- name: Create GitHub Release
58+
uses: softprops/action-gh-release@v2
59+
with:
60+
tag_name: vsix
61+
files: VSIX/snow-cli-${{ env.PACKAGE_VERSION }}.vsix
62+
name: Release VSCode extension
63+
body: |
64+
## 🚀 Snow CLI VSCode extension
65+
Latest release version: `v${{ env.PACKAGE_VERSION }}`
66+
67+
### Requirements
68+
69+
Install Snow CLI globally:
70+
71+
```bash
72+
npm install -g snow-ai
73+
```
74+
75+
### Usage
76+
77+
1. Open any file in VSCode
78+
2. Click the **Snow icon** button in the editor toolbar (top right)
79+
3. A terminal opens with Snow CLI running
80+
4. The extension automatically connects via WebSocket
81+
draft: false
82+
prerelease: false

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121

2222
steps:
2323
- name: Checkout code
24-
uses: actions/checkout@v4
24+
uses: actions/checkout@v6
2525

2626
- name: Setup Node.js
27-
uses: actions/setup-node@v4
27+
uses: actions/setup-node@v6
2828
with:
2929
node-version: '18'
3030
registry-url: 'https://registry.npmjs.org/'

VSIX/package-lock.json

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

VSIX/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
},
5252
"devDependencies": {
5353
"@types/vscode": "^1.75.0",
54-
"@types/node": "18.x",
54+
"@types/node": "20.x",
5555
"@types/ws": "^8.5.8",
5656
"@typescript-eslint/eslint-plugin": "^5.45.0",
5757
"@typescript-eslint/parser": "^5.45.0",

VSIX/snow-cli-0.3.5.vsix

-224 KB
Binary file not shown.

VSIX/snow-cli-0.3.6.vsix

-224 KB
Binary file not shown.

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ You can also clone and build from source: https://github.com/MayDay-wpf/snow-cli
4444

4545
### Install VSCode Extension
4646

47-
- Download [VSIX/snow-cli-x.x.x.vsix](https://github.com/MayDay-wpf/snow-cli/blob/main/VSIX/)
47+
- Download [snow-cli-x.x.x.vsix](https://github.com/MayDay-wpf/snow-cli/releases/tag/vsix)
4848

4949
- Open VSCode, click `Extensions` -> `Install from VSIX...` -> select `snow-cli-0.2.6.vsix`
5050

readme_zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $ nvm use 16
4141

4242
## 安装 VSCode 扩展
4343

44-
- 下载 [VSIX/snow-cli-x.x.x.vsix](https://github.com/MayDay-wpf/snow-cli/blob/main/VSIX/)
44+
- 下载 [snow-cli-x.x.x.vsix](https://github.com/MayDay-wpf/snow-cli/releases/tag/vsix)
4545

4646
- 打开 VSCode,点击 `扩展` -> `从 VSIX 安装...` -> 选择 `snow-cli-0.2.6.vsix`
4747

0 commit comments

Comments
 (0)