-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.45 KB
/
Copy pathrelease.yml
File metadata and controls
63 lines (53 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Verify tag is on main
run: |
git fetch origin main
if ! git merge-base --is-ancestor HEAD origin/main; then
echo "❌ Release tags must be created from the main branch."
exit 1
fi
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build VSIX
run: npx vsce package
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: "*.vsix"
generate_release_notes: true
- name: Publish to Open VSX
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
run: |
if [ -z "$OVSX_PAT" ]; then
echo "⚠️ OVSX_PAT not set — skipping Open VSX publish"
else
npx ovsx publish *.vsix --pat "$OVSX_PAT"
fi
- name: Publish to VS Marketplace
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: |
if [ -z "$VSCE_PAT" ]; then
echo "⚠️ VSCE_PAT not set — skipping VS Marketplace publish"
else
npx vsce publish --pat "$VSCE_PAT"
fi