-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (64 loc) · 2.16 KB
/
Copy pathbuild.yaml
File metadata and controls
76 lines (64 loc) · 2.16 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
69
70
71
72
73
74
75
76
name: Build VSIX and Upload Artifact
on:
workflow_dispatch:
push:
jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
- name: Install global dependencies
run: |
npm install -g typescript prettier eslint vsce
- name: Install project dependencies
run: npm install
- name: Build .vsix package
run: npm run build
- name: Set .vsix file path
id: get_vsix
run: |
VERSION=$(jq -r '.version' package.json)
VSIX_PATH="./testdriver-${VERSION}.vsix"
if [ ! -f "$VSIX_PATH" ]; then
echo "VSIX file not found at $VSIX_PATH"
exit 1
fi
echo "vsix_path=$VSIX_PATH" >> $GITHUB_OUTPUT
- name: Publish to vsce
run: npx vsce publish --pat ${{ secrets.VSCODE_PUBLISH_PAT }}
- name: Extract version from package.json
id: get_version
run: |
VERSION=$(jq -r '.version' package.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Upload .vsix as artifact
uses: actions/upload-artifact@v4
with:
name: vscode-extension
path: ${{ steps.get_vsix.outputs.vsix_path }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: v${{ steps.get_version.outputs.version }}
release_name: Release v${{ steps.get_version.outputs.version }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload .vsix to GitHub Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.get_vsix.outputs.vsix_path }}
asset_name: testdriver.vsix
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}