-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (172 loc) · 7 KB
/
build-hls.yml
File metadata and controls
200 lines (172 loc) · 7 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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: Build Haxe Language Server Binaries
on:
workflow_dispatch:
jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- runner: windows-latest
os: windows-x64
- runner: windows-11-arm
os: windows-arm64
- runner: ubuntu-latest
os: linux
- runner: macos-latest
os: macos
steps:
- name: Checkout repository with submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: latest
- name: Install pkg
run: npm install -g @yao-pkg/pkg
- name: Build binaries (Windows x64)
if: matrix.os == 'windows-x64'
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path bin\win | Out-Null
pkg language-servers/haxe/server.js --targets node22-win-x64 --output bin/win/haxe-language-server-x64
- name: Zip artifacts (Windows x64)
if: matrix.os == 'windows-x64'
shell: pwsh
run: |
cd bin\win
7z a haxe-language-server-win-x64.zip haxe-language-server-x64.exe
- name: Upload Windows x64
if: matrix.os == 'windows-x64'
uses: actions/upload-artifact@v4
with:
name: haxe-language-server-win-x64
path: bin/win/haxe-language-server-win-x64.zip
- name: Build binaries (Windows arm64)
if: matrix.os == 'windows-arm64'
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path bin\win | Out-Null
pkg language-servers/haxe/server.js --targets node22-win-arm64 --output bin/win/haxe-language-server-arm64
- name: Zip artifacts (Windows arm64)
if: matrix.os == 'windows-arm64'
shell: pwsh
run: |
cd bin\win
7z a haxe-language-server-win-arm64.zip haxe-language-server-arm64.exe
- name: Upload Windows arm64
if: matrix.os == 'windows-arm64'
uses: actions/upload-artifact@v4
with:
name: haxe-language-server-win-arm64
path: bin/win/haxe-language-server-win-arm64.zip
- name: Build binaries (Linux)
if: matrix.os == 'linux'
run: |
sudo apt update
sudo apt install qemu-user-binfmt
mkdir -p bin/linux
pkg language-servers/haxe/server.js --targets node22-linuxstatic-x64 --output bin/linux/haxe-language-server-x64
pkg language-servers/haxe/server.js --targets node22-linuxstatic-arm64 --output bin/linux/haxe-language-server-arm64
pkg language-servers/haxe/server.js --targets node20-linuxstatic-armv7 --output bin/linux/haxe-language-server-armv7
- name: Zip artifacts (Linux)
if: matrix.os == 'linux'
run: |
cd bin/linux
zip haxe-language-server-linux-x64.zip haxe-language-server-x64
zip haxe-language-server-linux-arm64.zip haxe-language-server-arm64
zip haxe-language-server-linux-armv7.zip haxe-language-server-armv7
- name: Upload Linux x64
if: matrix.os == 'linux'
uses: actions/upload-artifact@v4
with:
name: haxe-language-server-linux-x64
path: bin/linux/haxe-language-server-linux-x64.zip
- name: Upload Linux arm64
if: matrix.os == 'linux'
uses: actions/upload-artifact@v4
with:
name: haxe-language-server-linux-arm64
path: bin/linux/haxe-language-server-linux-arm64.zip
- name: Upload Linux armv7
if: matrix.os == 'linux'
uses: actions/upload-artifact@v4
with:
name: haxe-language-server-linux-armv7
path: bin/linux/haxe-language-server-linux-armv7.zip
- name: Build binaries (macOS)
if: matrix.os == 'macos'
run: |
mkdir -p bin/mac
pkg language-servers/haxe/server.js --targets node22-macos-x64 --output bin/mac/haxe-language-server-x64
pkg language-servers/haxe/server.js --targets node22-macos-arm64 --output bin/mac/haxe-language-server-arm64
- name: Zip artifacts (macOS)
if: matrix.os == 'macos'
run: |
cd bin/mac
zip haxe-language-server-mac-x64.zip haxe-language-server-x64
zip haxe-language-server-mac-arm64.zip haxe-language-server-arm64
- name: Upload macOS x64
if: matrix.os == 'macos'
uses: actions/upload-artifact@v4
with:
name: haxe-language-server-mac-x64
path: bin/mac/haxe-language-server-mac-x64.zip
- name: Upload macOS arm64
if: matrix.os == 'macos'
uses: actions/upload-artifact@v4
with:
name: haxe-language-server-mac-arm64
path: bin/mac/haxe-language-server-mac-arm64.zip
commit:
name: Collect and commit binaries
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Checkout repository with submodules
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Unzip Windows artifacts
run: |
mkdir -p bin/win
unzip -o artifacts/haxe-language-server-win-x64/haxe-language-server-win-x64.zip -d bin/win/
unzip -o artifacts/haxe-language-server-win-arm64/haxe-language-server-win-arm64.zip -d bin/win/
- name: Unzip Linux artifacts
run: |
mkdir -p bin/linux
unzip -o artifacts/haxe-language-server-linux-x64/haxe-language-server-linux-x64.zip -d bin/linux/
unzip -o artifacts/haxe-language-server-linux-arm64/haxe-language-server-linux-arm64.zip -d bin/linux/
unzip -o artifacts/haxe-language-server-linux-armv7/haxe-language-server-linux-armv7.zip -d bin/linux/
- name: Unzip macOS artifacts
run: |
mkdir -p bin/mac
unzip -o artifacts/haxe-language-server-mac-x64/haxe-language-server-mac-x64.zip -d bin/mac/
unzip -o artifacts/haxe-language-server-mac-arm64/haxe-language-server-mac-arm64.zip -d bin/mac/
- name: Restore executable permissions
run: |
chmod +x bin/linux/haxe-language-server-x64 \
bin/linux/haxe-language-server-arm64 \
bin/linux/haxe-language-server-armv7 \
bin/mac/haxe-language-server-x64 \
bin/mac/haxe-language-server-arm64
- name: Commit and push binaries
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add bin/
# Only commit if there is something new
git diff --cached --quiet && echo "No changes to commit." || \
git commit -m "ci: update pre-built language server binaries [skip ci]"
git push