WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 360bf51

Browse files
committed
add file release.yml
1 parent f16996a commit 360bf51

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build and Release VS Code Extension
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
build-and-release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v5
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '18'
22+
cache: 'npm'
23+
24+
- name: Install dependencies (vsce)
25+
run: npm install -g @vscode/vsce
26+
27+
- name: Sqlc Snippets
28+
id: sqlc_snippets
29+
run: |
30+
echo "Packaging VS Code extension..."
31+
32+
VSCODE_EXTENSION_NAME=$(node -p "require('./package.json').name")
33+
VSCODE_EXTENSION_VERSION=$(node -p "require('./package.json').version")
34+
VSCODE_EXTENSION_FILE="${VSCODE_EXTENSION_NAME}-${VSCODE_EXTENSION_VERSION}.vsix"
35+
echo "vsix_filename=${VSCODE_EXTENSION_FILE}" >> $GITHUB_OUTPUT
36+
echo "Generated file: ${VSCODE_EXTENSION_FILE}"
37+
38+
- name: Create GitHub Release and Upload Asset
39+
uses: softprops/action-gh-release@v2
40+
with:
41+
files: ${{ steps.sqlc_snippets.outputs.vsix_filename }}
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB }}

0 commit comments

Comments
 (0)