-
Notifications
You must be signed in to change notification settings - Fork 40
99 lines (95 loc) · 2.47 KB
/
hls.yaml
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
name: Language Server
on:
push:
branches: [main]
tags:
- hls-v*
pull_request:
branches: [main]
permissions:
contents: read
jobs:
build:
name: ${{ matrix.os.name }}
runs-on: ${{ matrix.os.runner }}
strategy:
fail-fast: false
matrix:
os:
- runner: ubuntu-latest
name: ubuntu
artifact: linux-x64
exe: hemtt-language-server
- runner: windows-latest
name: windows
artifact: windows-x64
exe: hemtt-language-server.exe
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
key: hls-${{ matrix.os.name }}
- name: Compile
run: |
cd hls
cargo build --release
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os.artifact }}
path: target/release/${{ matrix.os.exe }}
- name: Upload Language (Linux)
if: startsWith(matrix.os.runner, 'ubuntu')
uses: actions/upload-artifact@v4
with:
name: languages
path: hls/languages
package:
name: Package
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: linux-x64
path: linux
- uses: actions/download-artifact@v4
with:
name: windows-x64
path: windows
- name: Set Executable
run: |
chmod +x linux/hemtt-language-server
- name: Move Server
run: |
mv linux/hemtt-language-server hls/hemtt-language-server
mv windows/hemtt-language-server.exe hls/hemtt-language-server.exe
- name: Remove Existing Languages
run: |
rm -rf hls/languages
- name: Download Languages
uses: actions/download-artifact@v4
with:
name: languages
path: hls/languages
- name: Package
run: |
cd hls
npm install
npm install -g @vscode/vsce
vsce package
- name: Upload
uses: actions/upload-artifact@v4
with:
name: hls
path: hls/*.vsix
- name: Publish
if: startsWith(github.ref, 'refs/tags/')
run: |
cd hls
vsce publish -p ${{ secrets.VSCE_TOKEN }}