-
Notifications
You must be signed in to change notification settings - Fork 11
247 lines (247 loc) · 8 KB
/
skyeye.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
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
242
243
244
245
246
247
name: SkyEye
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Build whisper.cpp
uses: ./.github/actions/build-whisper
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
- name: vet
run: make vet
- name: Format
run: go fmt ./... && git diff --exit-code
- name: Tidy
run: go mod tidy && git diff --exit-code
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Build whisper.cpp
uses: ./.github/actions/build-whisper
- name: Test
run: |
go run gotest.tools/gotestsum -- -tags nolibopusfile ./...
build-linux-amd64:
name: Build on Linux AMD64
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Build whisper.cpp
uses: ./.github/actions/build-whisper
- name: Build SkyEye
run: make skyeye
- name: Build SkyEye Scaler
run: make skyeye-scaler
- name: Create dist
shell: bash
run: |
mkdir -p dist/skyeye-linux-amd64/docs/
cp skyeye dist/skyeye-linux-amd64/skyeye
cp skyeye-scaler dist/skyeye-linux-amd64/skyeye-scaler
chmod +x dist/skyeye-linux-amd64/skyeye
chmod +x dist/skyeye-linux-amd64/skyeye-scaler
cp README.md dist/skyeye-linux-amd64/README.md
cp LICENSE dist/skyeye-linux-amd64/LICENSE
cp config.yaml dist/skyeye-linux-amd64/config.yaml
cp docs/*.md dist/skyeye-linux-amd64/docs/
tar -czf dist/skyeye-linux-amd64.tar.gz -C dist skyeye-linux-amd64
- name: Upload artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: skyeye-linux-amd64.tar.gz
path: dist/skyeye-linux-amd64.tar.gz
if-no-files-found: error
overwrite: true
build-macos-arm64:
name: Build on macOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
shell: bash
run: make install-macos-dependencies
- name: Build whisper.cpp
uses: ./.github/actions/build-whisper
with:
os: macos
arch: arm64
cc: clang
- name: Build SkyEye
run: make skyeye
- name: Build SkyEye Scaler
run: make skyeye-scaler
- name: Create dist
shell: bash
run: |
mkdir -p dist/skyeye-macos-arm64/docs/
cp skyeye dist/skyeye-macos-arm64/skyeye
cp skyeye-scaler dist/skyeye-macos-arm64/skyeye-scaler
chmod +x dist/skyeye-macos-arm64/skyeye
chmod +x dist/skyeye-macos-arm64/skyeye-scaler
cp README.md dist/skyeye-macos-arm64/README.md
cp LICENSE dist/skyeye-macos-arm64/LICENSE
cp config.yaml dist/skyeye-macos-arm64/config.yaml
cp docs/*.md dist/skyeye-macos-arm64/docs/
tar -czf dist/skyeye-macos-arm64.tar.gz -C dist skyeye-macos-arm64
- name: Upload artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: skyeye-macos-arm64.tar.gz
path: dist/skyeye-macos-arm64.tar.gz
if-no-files-found: error
overwrite: true
build-windows-amd64:
name: Build on Windows AMD64
runs-on: windows-latest
env:
GOROOT: /ucrt64/lib/go
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
install: |
base-devel
git
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-toolchain
mingw-w64-ucrt-x86_64-opus
mingw-w64-ucrt-x86_64-libsoxr
mingw-w64-ucrt-x86_64-openblas
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-go
mingw-w64-ucrt-x86_64-curl
zip
- name: Build whisper.cpp
uses: ./.github/actions/build-whisper
with:
os: windows
shell: msys2 {0}
- name: Build Skyeye
shell: msys2 {0}
run: make skyeye.exe
- name: Build Skyeye Scaler
shell: msys2 {0}
run: make skyeye-scaler.exe
- name: Create dist
shell: msys2 {0}
run: |
mkdir -p dist/skyeye-windows-amd64/docs/
cp skyeye.exe dist/skyeye-windows-amd64/skyeye.exe
cp skyeye-scaler.exe dist/skyeye-windows-amd64/skyeye-scaler.exe
curl -fsL https://github.com/winsw/winsw/releases/download/v2.12.0/WinSW-x64.exe -o winsw.exe
cp README.md dist/skyeye-windows-amd64/README.md
cp LICENSE dist/skyeye-windows-amd64/LICENSE
cp config.yaml dist/skyeye-windows-amd64/config.yaml
cp docs/*.md dist/skyeye-windows-amd64/docs/
cp winsw.exe dist/skyeye-windows-amd64/skyeye-service.exe
cp init/winsw/skyeye-service.yml dist/skyeye-windows-amd64/skyeye-service.yml
cp winsw.exe dist/skyeye-windows-amd64/skyeye-scaler-service.exe
cp init/winsw/skyeye-scaler-service.yml dist/skyeye-windows-amd64/skyeye-scaler-service.yml
cd dist
zip -r skyeye-windows-amd64.zip skyeye-windows-amd64
- name: Upload artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: skyeye-windows-amd64.zip
path: dist/skyeye-windows-amd64.zip
if-no-files-found: error
overwrite: true
build-image:
name: Build container image
if: "!startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build image
uses: docker/build-push-action@v6
with:
build-args: |
SKYEYE_VERSION: ${{ env.GITHUB_REF_NAME }}
release:
name: Upload release assets
if: startsWith(github.ref, 'refs/tags/')
needs:
- lint
- test
- build-linux-amd64
- build-windows-amd64
- build-macos-arm64
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: skyeye-*
path: dist
merge-multiple: true
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
dist/skyeye-linux-amd64.tar.gz
dist/skyeye-macos-arm64.tar.gz
dist/skyeye-windows-amd64.zip
token: ${{ secrets.RELEASE_TOKEN }}
push-images:
name: Build and push container images
if: startsWith(github.ref, 'refs/tags/')
needs:
- lint
- test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build and push image
uses: ./.github/actions/build-container
with:
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
image-name: ${{ github.repository }}
target: skyeye
skyeye-version: ${{ env.GITHUB_REF_NAME }}
- name: Build and push scaler image
uses: ./.github/actions/build-container
with:
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
image-name: ${{ github.repository }}-scaler
target: skyeye-scaler
skyeye-version: ${{ env.GITHUB_REF_NAME }}