-
Notifications
You must be signed in to change notification settings - Fork 2
107 lines (105 loc) · 3.23 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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Publish
on:
workflow_dispatch:
inputs:
PUBLISH:
description: 'Publish the extension to marketplace?'
required: true
default: false
type: boolean
PUBLISH_VERSION:
description: 'Version to publish - "major", "minor", "patch" or explicit version number'
required: true
default: 'patch'
type: string
jobs:
build-native:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: windows-latest
binary: dotvvm-language-server.exe
output-name: dotvvm-language-server-x64-win.exe
- os: ubuntu-latest
binary: dotvvm-language-server
output-name: dotvvm-language-server-x64-linux
- os: macos-latest
binary: dotvvm-language-server
output-name: dotvvm-language-server-x64-macos
runs-on: ${{ matrix.os }}
env:
CXXFLAGS: '--std=c++14'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'yarn'
cache-dependency-path: |
src/tree-sitter-dotvvm/yarn.lock
src/dothtml-basic-ls/yarn.lock
- name: Build tree sitter
run: |
cd src/tree-sitter-dotvvm
yarn install --immutable
yarn build
- name: Build language server
run: |
cd src/dothtml-basic-ls
yarn install --immutable
yarn build
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.output-name }}
path: src/dothtml-basic-ls/dist/${{ matrix.binary }}
build-package:
runs-on: ubuntu-latest
needs: build-native
steps:
- uses: actions/checkout@v3
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: ~/artifacts
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'yarn'
cache-dependency-path: |
src/tree-sitter-dotvvm/yarn.lock
src/dothtml-basic-ls/yarn.lock
src/dotvvm-vscode/yarn.lock
- name: Build
run: |
cd src/tree-sitter-dotvvm
yarn install --immutable
yarn build
cd ../dothtml-basic-ls
yarn install --immutable
yarn build
cd ../dotvvm-vscode
mkdir dist
for ls in ~/artifacts/dotvvm-language-server*; do
cp "$ls"/dotvvm-language-server* "dist/$(basename "$ls")"
done
yarn install --immutable
yarn build
- name: Publish package
run: |
yarn run vsce package '${{ inputs.PUBLISH_VERSION }}' --no-dependencies
working-directory: src/dotvvm-vscode
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: package
path: src/dotvvm-vscode/*.vsix
- name: Publish package
if: ${{ inputs.PUBLISH }}
run: |
yarn run vsce publish '${{ inputs.PUBLISH_VERSION }}' --no-dependencies --yarn
working-directory: src/dotvvm-vscode
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}