-
Notifications
You must be signed in to change notification settings - Fork 1
241 lines (211 loc) · 6.41 KB
/
Copy pathrelease.yml
File metadata and controls
241 lines (211 loc) · 6.41 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
name: release
on:
workflow_dispatch:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
cli:
name: cli (${{ matrix.target }})
strategy:
fail-fast: false
matrix:
include:
- target: linux-amd64
os: ubuntu-latest
goos: linux
goarch: amd64
- target: linux-386
os: ubuntu-latest
goos: linux
goarch: "386"
- target: linux-arm64
os: ubuntu-latest
goos: linux
goarch: arm64
- target: linux-armv6
os: ubuntu-latest
goos: linux
goarch: arm
goarm: "6"
- target: linux-armv7
os: ubuntu-latest
goos: linux
goarch: arm
goarm: "7"
- target: windows-amd64
os: ubuntu-latest
goos: windows
goarch: amd64
- target: windows-386
os: ubuntu-latest
goos: windows
goarch: "386"
- target: windows-arm64
os: ubuntu-latest
goos: windows
goarch: arm64
- target: android-arm64
os: ubuntu-latest
goos: android
goarch: arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.26.4"
cache: true
- name: Setup mise tools
uses: jdx/mise-action@v2
with:
install: true
cache: true
- name: Setup Android NDK
id: setup-ndk
if: matrix.goos == 'android'
uses: nttld/setup-ndk@v1
with:
ndk-version: r27c
- name: Export Android NDK
if: matrix.goos == 'android'
run: echo "ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >> "${GITHUB_ENV}"
- name: Resolve native toolchain
shell: bash
run: |
set -euo pipefail
native_target="${{ matrix.goos }}/${{ matrix.goarch }}"
if [[ -n "${{ matrix.goarm }}" ]]; then
native_target="${native_target}/${{ matrix.goarm }}"
fi
export NATIVE_CROSS_TARGETS="${native_target}"
./scripts/bootstrap-native-toolchains.sh --install
./scripts/bootstrap-native-toolchains.sh
./scripts/bootstrap-native-toolchains.sh --emit-github-env >> "${GITHUB_ENV}"
- name: Build full-feature CLI
shell: bash
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
run: |
set -euo pipefail
./scripts/build-release-cli-native.sh "${{ matrix.target }}" "${GOOS}" "${GOARCH}" "${GOARM:-}"
- name: Archive
shell: bash
run: |
set -euo pipefail
cd dist
if [[ "${{ matrix.goos }}" == "windows" ]]; then
zip -r "glua-${{ matrix.target }}.zip" "${{ matrix.target }}"
else
tar -czf "glua-${{ matrix.target }}.tar.gz" "${{ matrix.target }}"
fi
- name: Upload CLI artifact
uses: actions/upload-artifact@v4
with:
name: glua-${{ matrix.target }}
path: |
dist/glua-${{ matrix.target }}.tar.gz
dist/glua-${{ matrix.target }}.zip
if-no-files-found: ignore
vscode-extension:
name: vscode extension
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: vscode/extensions/glua-lsp/package-lock.json
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.26.4"
cache: true
- name: Build bundled gluals executables
run: ./scripts/build-gluals-platforms.sh
- name: Package VS Code extension
run: make package-vscode
- name: Verify VS Code bundled gluals executables
run: ./scripts/check-gluals-extension-package.sh vscode dist/glua-lsp-vscode.vsix
- name: Upload VS Code extension artifact
uses: actions/upload-artifact@v4
with:
name: glua-lsp-vscode
path: dist/*.vsix
jetbrains-extension:
name: jetbrains extension
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: "9.0.0"
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.26.4"
cache: true
- name: Build bundled gluals executables
run: ./scripts/build-gluals-platforms.sh
- name: Package JetBrains extension
shell: bash
run: |
set -euo pipefail
for attempt in 1 2 3; do
if make package-jetbrains; then
exit 0
fi
if [ "${attempt}" = "3" ]; then
exit 1
fi
rm -rf jetbrains/extensions/glua-lsp/.gradle jetbrains/extensions/glua-lsp/build
sleep $((attempt * 10))
done
- name: Verify JetBrains bundled gluals executables
run: ./scripts/check-gluals-extension-package.sh jetbrains dist/glua-jetbrains-*.zip
- name: Upload JetBrains extension artifact
uses: actions/upload-artifact@v4
with:
name: glua-lsp-jetbrains
path: dist/*.zip
github-release:
name: github release
runs-on: ubuntu-latest
needs:
- cli
- vscode-extension
- jetbrains-extension
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate bilingual release notes
run: ./scripts/generate-release-notes.sh release-notes.md
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: release-assets
merge-multiple: true
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: release-assets/*
body_path: release-notes.md