-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (76 loc) · 2.01 KB
/
main.yml
File metadata and controls
78 lines (76 loc) · 2.01 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Build & Publish
on:
push:
branches: [master]
pull_request:
branches: [master]
release:
types: [published]
jobs:
build:
strategy:
matrix:
os:
- ubuntu-latest
vscodeVersion:
# - 1.64.2
- stable
runs-on: ${{ matrix.os }}
name: Build
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4.2.0
with:
node-version: 20
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x.x'
- name: Install NPM Packages
run: npm ci
- name: Lint
run: npm run lint
- name: Install webview-ui NPM Packages
run: npm ci
working-directory: ./webview-ui
- name: Lint webview-ui
run: npm run lint
working-directory: ./webview-ui
- name: Build webview-ui
run: npm run build
working-directory: ./webview-ui
- name: Package extension
run: npm run package
- name: Prepare test project
run: |
dotnet tool restore
dotnet build
dotnet ef --version
working-directory: ./sample_dotnet
publish:
name: Publish
runs-on: ubuntu-latest
needs: [build]
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.2.0
with:
node-version: 20
- name: Install packages
run: npm ci
- name: Install webview-ui NPM Packages
run: npm ci
working-directory: ./webview-ui
- name: Build webview-ui
run: npm run build
working-directory: ./webview-ui
- name: Build & publish extension
env:
AZURE_TOKEN: ${{ secrets.AZURE_TOKEN }}
run: |
tag=${GITHUB_REF#refs/tags/}
echo "Setting package version $tag"
npm --no-git-tag-version version "$tag"
npm run publish -- -p "$AZURE_TOKEN"