-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.46 KB
/
deploy.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
51
52
name: Deploy VSCode Extension
on:
push:
branches:
- master # or the branch you want to trigger deployment from
workflow_dispatch: # Allows manual triggering
jobs:
release:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
# Step 3: Install dependencies
- name: Install dependencies
run: npm install
# Step 4: Lint, build, and test (optional but recommended)
- name: Run build and tests
run: |
npm run compile # if you have a linting step
# npm run build # if you have a build step
# npm test # if you have tests
# Step 5: Package and publish the extension
- name: Publish VSCode Extension
uses: lannonbr/[email protected]
with:
args: "publish -p $VSCE_TOKEN"
env:
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
# Step 6: Create a GitHub Release
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: "v${{ steps.get_version.outputs.version }}"
name: "Release v${{ steps.get_version.outputs.version }}"
artifacts: "*.vsix"
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}