forked from raspberrypi/pico-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (58 loc) · 1.78 KB
/
release.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
53
54
55
56
57
58
59
60
61
name: Build .vsix release asset
on:
push:
pull_request:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Setup node v18
uses: actions/setup-node@v4
with:
# the current node version use in vscode
node-version: '18'
cache: 'yarn'
- name: Install Dependencies
run: |
npm i -g @vscode/vsce ovsx
yarn
- name: Package Extension
run: |
yarn lint
vsce package
- name: Test PAT
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
env:
VSCE_PAT: ${{ secrets.VSCODE_MARKETPLACE_PAT }}
run: |
vsce verify-pat raspberry-pi
- name: Test OVSX PAT
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
run: |
npx ovsx verify-pat -p ${{ secrets.OPEN_VSX_PAT }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: raspberry-pi-pico
path: raspberry-pi-pico-*.vsix
- name: Add Release Asset
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: raspberry-pi-pico-*.vsix
- name: Publish Extension
if: startsWith(github.ref, 'refs/tags/')
env:
VSCE_PAT: ${{ secrets.VSCODE_MARKETPLACE_PAT }}
run: |
vsce publish -i raspberry-pi-pico-*.vsix
- name: Publish Extension to OVSX
if: startsWith(github.ref, 'refs/tags/')
run: |
npx ovsx publish raspberry-pi-pico-*.vsix -p ${{ secrets.OPEN_VSX_PAT }}