-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.3 KB
/
publish.yml
File metadata and controls
56 lines (46 loc) · 1.3 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
name: Publish Extension
on:
push:
branches: [main]
release:
types: [published]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
VSCE_PAT: ${{ secrets.VSCE_PAT }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Compile
run: npm run compile
- name: Run tests
run: npm test
- name: Auto-bump patch version
if: github.event_name == 'push'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
npm version patch -m "chore: bump version to %s [skip ci]"
git push
git push --tags
- name: Package extension
run: npx @vscode/vsce package
- name: Publish to Open VSX
if: env.OVSX_PAT != ''
run: npx ovsx publish *.vsix -p "${{ env.OVSX_PAT }}"
- name: Publish to VS Code Marketplace
if: env.VSCE_PAT != ''
run: npx @vscode/vsce publish -p "${{ env.VSCE_PAT }}"