-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (56 loc) · 1.81 KB
/
release.yml
File metadata and controls
68 lines (56 loc) · 1.81 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
64
65
66
67
68
# Copyright IBM Corp. 2025
# Assisted by CursorAI
name: Release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Validate tag matches package.json version
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
TAG_VERSION=${GITHUB_REF#refs/tags/v}
echo "Package version: $PACKAGE_VERSION"
echo "Tag version: $TAG_VERSION"
if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then
echo "❌ Error: Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)"
exit 1
fi
echo "✅ Version validation passed"
- name: Compile extension
run: npm run compile
- name: Package VSIX
run: npx @vscode/vsce package --no-yarn
- name: Upload VSIX artifact
uses: actions/upload-artifact@v4
with:
name: vscode-stepzen-${{ github.ref_name }}
path: "*.vsix"
retention-days: 30
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: "*.vsix"
generate_release_notes: true
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Optional: Uncomment and add VSCE_PAT secret to enable marketplace publishing
# - name: Publish to Marketplace (optional)
# if: ${{ secrets.VSCE_PAT }}
# run: npx @vscode/vsce publish --no-yarn
# env:
# VSCE_PAT: ${{ secrets.VSCE_PAT }}