-
Notifications
You must be signed in to change notification settings - Fork 6
46 lines (35 loc) · 1.33 KB
/
publish.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
name: Publish
on:
push:
branches: ["main"]
tags: ["v*.*.*"]
paths-ignore: ["*.md"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install NPM dependencies
run: npm ci
- name: Update extension information (dev)
if: ${{ github.ref == 'refs/heads/main' }}
run: npm run updateversion -- --environment dev --version "1.1.${{ github.run_number }}"
- name: Update extension information (prod)
if: ${{ contains(github.ref, 'refs/tags/') }}
run: npm run updateversion -- --environment prod --version "${{ github.ref_name }}"
- name: Run tests
run: npm run test
- name: Package extension
run: npm run package
- name: Publish to VS Marketplace (dev)
if: ${{ github.ref == 'refs/heads/main' }}
run: find .output/ -name '*.vsix' -exec npm run publish:dev -- -t ${{ secrets.marketplace_access_token }} --vsix {} \;
- name: Publish to VS Marketplace (prod)
if: ${{ contains(github.ref, 'refs/tags/') }}
run: find .output/ -name '*.vsix' -exec npm run publish:prod -- -t ${{ secrets.marketplace_access_token }} --vsix {} \;