-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (39 loc) · 1.43 KB
/
release-extension.yml
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
name: Release VSCode Extension
on:
push:
branches:
- main
jobs:
package:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install Dependencies
run: npm install
- name: Install vsce
run: npm install -g @vscode/vsce
# Read package.json and set variables
- name: Read package.json
run: |
extension_name=$(node -p "require('./package.json').name")
extension_version=$(node -p "require('./package.json').version")
echo "EXTENSION_NAME=$extension_name" >> $GITHUB_ENV
echo "EXTENSION_VERSION=$extension_version" >> $GITHUB_ENV
# fixme: run tests
# - name: Run Tests
# run: npm run test
- name: Package Extension
run: npx vsce package
# Rename the vsix file
- name: Rename VSIX
run: mv *.vsix ${{ env.EXTENSION_NAME }}.v${{ env.EXTENSION_VERSION }}.vsix
# Create GitHub Pre Release and Upload VSIX
- name: Create GitHub Pre Release and Upload VSIX
run: |
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
gh release create v${{ env.EXTENSION_VERSION }} ./${{ env.EXTENSION_NAME }}.v${{ env.EXTENSION_VERSION }}.vsix --prerelease -t "blits-vscode v${{ env.EXTENSION_VERSION }}" -n "Version ${{ env.EXTENSION_VERSION }} of ${{ env.EXTENSION_NAME }}"