Skip to content

Commit c2e9bd9

Browse files
authored
Merge branch 'main' into develop
2 parents d4b8dae + db1afa0 commit c2e9bd9

File tree

2 files changed

+69
-1
lines changed

2 files changed

+69
-1
lines changed

.github/workflows/build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build Extension Package
2+
3+
on:
4+
push:
5+
branches:
6+
- extension_test
7+
paths-ignore:
8+
- '.github/workflows/**' # Ignore changes to workflow files
9+
workflow_dispatch: # Allow manual trigger
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '18'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Compile
28+
run: npm run compile
29+
30+
- name: Install vsce
31+
run: npm install -g @vscode/vsce
32+
33+
- name: Package Extension
34+
run: vsce package
35+
36+
- name: Get Package Info
37+
id: package
38+
run: |
39+
VSIX_PATH=$(ls *.vsix)
40+
echo "Package created: $VSIX_PATH"
41+
echo "vsix_path=$VSIX_PATH" >> $GITHUB_OUTPUT
42+
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
43+
44+
- name: Upload VSIX as artifact
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: extension-test-${{ steps.package.outputs.date }}
48+
path: "*.vsix"
49+
retention-days: 7

.github/workflows/publish.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
name: Publish Extension
1+
name: Publish Extension to Visual Studio Marketplace
22

33
on:
44
push:
55
branches:
66
- main
7+
paths-ignore:
8+
- '.github/workflows/**' # Ignore changes to workflow files
79
workflow_dispatch: # Allow manual trigger
810

911
jobs:
@@ -82,5 +84,22 @@ jobs:
8284
- name: Package Extension
8385
run: vsce package
8486

87+
- name: Get Package Info
88+
id: package
89+
run: |
90+
VSIX_PATH=$(ls *.vsix)
91+
echo "Package created: $VSIX_PATH"
92+
echo "vsix_path=$VSIX_PATH" >> $GITHUB_OUTPUT
93+
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
94+
VERSION=$(node -p "require('./package.json').version")
95+
echo "version=$VERSION" >> $GITHUB_OUTPUT
96+
97+
- name: Upload VSIX as artifact
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: extension-release-v${{ steps.package.outputs.version }}-${{ steps.package.outputs.date }}
101+
path: "*.vsix"
102+
retention-days: 400 # Maximum retention period allowed by GitHub
103+
85104
- name: Publish to Visual Studio Marketplace
86105
run: vsce publish -p "${{ secrets.VSC_PAT }}"

0 commit comments

Comments
 (0)