forked from akiyosi/goneovim
-
Notifications
You must be signed in to change notification settings - Fork 0
411 lines (352 loc) · 13.5 KB
/
release.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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
name: Release
on:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name for release'
required: false
default: nightly
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
linux:
strategy:
matrix:
go-version: [1.16.x]
platform: [ubuntu-latest]
qtversion: [5.14.1]
runs-on: ${{ matrix.platform }}
env:
GOPATH: ${{ github.workspace }}
QT_DIR: ${{ github.workspace }}/Qt
QT_VERSION: ${{ matrix.qtversion }}
QT_API: 5.13.0
QT_DEBUG: false
GO111MODULE: off
GOPROXY: https://goproxy.io
steps:
- name: Linux prerequisites
run: |
sudo apt update
sudo apt-get -y install build-essential libglu1-mesa-dev libpulse-dev libglib2.0-dev
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Install Qt for linux
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qtversion }}
host: linux
target: desktop
dir: ${{ github.workspace }}
modules: 'qtcharts qtdatavis3d qtpurchasing qtvirtualkeyboard qtwebengine qtnetworkauth qtwebglplugin qtscript'
- name: Get Qt binding for Go
run: |
go get -v github.com/therecipe/qt/cmd/...
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ./src/github.com/${{ github.repository }}
- name: Free disk space
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
- name: Generate Qt bindings
run: $(go env GOPATH)/bin/qtsetup -test=false
- name: Get dependencies
run: |
go get -v -t -d github.com/${{ github.repository }}/...
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim
$(go env GOPATH)/bin/qtmoc
- name: Retrieve version
id: version-linux
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
echo "::set-output name=GONEOVIM_VERSION::$(git describe --tags)"
- name: Build
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim
$(go env GOPATH)/bin/qtdeploy -ldflags "-X github.com/akiyosi/goneovim/editor.Version=${{ steps.version-linux.outputs.GONEOVIM_VERSION }}" build desktop
cp -pR ../../runtime ./deploy/linux/
- name: Archive
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy
mv linux goneovim-linux
tar -jcvf goneovim-linux.tar.bz2 goneovim-linux
- name: Upload
uses: actions/upload-artifact@v1
with:
name: goneovim-linux
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy/goneovim-linux.tar.bz2
archlinux:
strategy:
matrix:
go-version: [1.16.x]
platform: [ubuntu-latest]
qtversion: [5.15.1]
runs-on: ${{ matrix.platform }}
env:
GOPATH: ${{ github.workspace }}
QT_DIR: ${{ github.workspace }}/Qt
QT_VERSION: ${{ matrix.qtversion }}
QT_API: 5.13.0
QT_DEBUG: false
GO111MODULE: off
GOPROXY: https://goproxy.io
steps:
- name: Linux prerequisites
run: |
sudo apt update
sudo apt-get -y install build-essential libglu1-mesa-dev libpulse-dev libglib2.0-dev zip
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Install Qt for linux
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qtversion }}
host: linux
target: desktop
dir: ${{ github.workspace }}
modules: 'qtcharts qtdatavis3d qtpurchasing qtvirtualkeyboard qtwebengine qtnetworkauth qtwebglplugin qtscript'
- name: Get Qt binding for Go
run: |
go get -v github.com/therecipe/qt/cmd/...
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ./src/github.com/${{ github.repository }}
- name: Free disk space
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
- name: Generate Qt bindings
run: $(go env GOPATH)/bin/qtsetup -test=false
- name: Get dependencies
run: |
go get -v -t -d github.com/${{ github.repository }}/...
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim
$(go env GOPATH)/bin/qtmoc
- name: Retrieve version
id: version-linux
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
echo "::set-output name=GONEOVIM_VERSION::$(git describe --tags)"
- name: Build for linux
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim
$(go env GOPATH)/bin/qtdeploy -ldflags "-X github.com/akiyosi/goneovim/editor.Version=${{ steps.version-linux.outputs.GONEOVIM_VERSION }}" -docker build linux_arch
cp -pR ../../runtime ./deploy/linux/
- name: Archive
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy
mv linux goneovim-archlinux
tar -jcvf goneovim-archlinux.tar.bz2 goneovim-archlinux
- name: Upload
uses: actions/upload-artifact@v1
with:
name: goneovim-archlinux
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy/goneovim-archlinux.tar.bz2
windows:
strategy:
matrix:
go-version: [1.16.x]
platform: [ubuntu-latest]
qtversion: [5.15.1]
runs-on: ${{ matrix.platform }}
env:
GOPATH: ${{ github.workspace }}
QT_DIR: ${{ github.workspace }}/Qt
QT_VERSION: ${{ matrix.qtversion }}
QT_API: 5.13.0
QT_DEBUG: false
GO111MODULE: off
GOPROXY: https://goproxy.io
steps:
- name: Linux prerequisites
run: |
sudo apt update
sudo apt-get -y install build-essential libglu1-mesa-dev libpulse-dev libglib2.0-dev zip
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Install Qt for linux
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qtversion }}
host: linux
target: desktop
dir: ${{ github.workspace }}
modules: 'qtcharts qtdatavis3d qtpurchasing qtvirtualkeyboard qtwebengine qtnetworkauth qtwebglplugin qtscript'
- name: Get Qt binding for Go
run: |
go get -v github.com/therecipe/qt/cmd/...
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ./src/github.com/${{ github.repository }}
- name: Free disk space
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
- name: Generate Qt bindings
run: $(go env GOPATH)/bin/qtsetup -test=false
- name: Get dependencies
run: |
go get -v -t -d github.com/${{ github.repository }}/...
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim
$(go env GOPATH)/bin/qtmoc
- name: Retrieve version
id: version-linux
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
echo "::set-output name=GONEOVIM_VERSION::$(git describe --tags)"
- name: Build for windows
run: |
cd ${{ github.workspace }}/src/github.com/akiyosi
git clone https://github.com/akiyosi/w32.git
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim
rm -fr ../../editor/moc*
$(go env GOPATH)/bin/qtdeploy -ldflags "-X github.com/akiyosi/goneovim/editor.Version=${{ steps.version-linux.outputs.GONEOVIM_VERSION }}" -docker build windows_64_static
cp -pR ../../runtime ./deploy/windows/
- name: Archive
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy
mv windows goneovim-windows
zip goneovim-windows -r goneovim-windows
- name: Upload
uses: actions/upload-artifact@v1
with:
name: goneovim-windows
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy/goneovim-windows.zip
macos:
strategy:
matrix:
go-version: [1.16.x]
platform: [macos-10.15]
qtversion: [5.15.2]
runs-on: ${{ matrix.platform }}
env:
GOPATH: ${{ github.workspace }}
QT_DIR: ${{ github.workspace }}/Qt
QT_VERSION: ${{ matrix.qtversion }}
QT_API: 5.13.0
QT_DEBUG: false
GO111MODULE: off
GOPROXY: https://goproxy.io
QMAKE_APPLE_DEVICE_ARCHS: arm64
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Install Qt for macOS
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qtversion }}
host: mac
target: desktop
dir: ${{ github.workspace }}
modules: 'qtcharts qtdatavis3d qtpurchasing qtvirtualkeyboard qtwebengine qtnetworkauth qtwebglplugin qtscript'
setup-python: 'false'
- name: Get Qt binding for Go
run: |
go get -v github.com/therecipe/qt/cmd/...
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ./src/github.com/${{ github.repository }}
- uses: actions/cache@v2
id: cache-qt-bindings-macos-11
with:
path: ${{ github.workspace }}/src/github.com/therecipe
key: ${{ matrix.qtversion }}-qtbindings-macos-11-${{ env.cache-version }}
- name: Generate Qt bindings
continue-on-error: true
if: ${{ steps.cache-qt-bindings-macos-11.outputs.cache-hit != 'true' }}
run: $(go env GOPATH)/bin/qtsetup -test=false
- name: Get dependencies
run: |
go get -v -t -d github.com/${{ github.repository }}/...
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim
$(go env GOPATH)/bin/qtmoc
- name: Retrieve version
id: version-macos-11
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
echo "::set-output name=GONEOVIM_VERSION::$(git describe --tags)"
echo "::set-output name=GONEOVIM_VERSION_HASH::$(git rev-parse HEAD)"
- name: Build
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim
$(go env GOPATH)/bin/qtdeploy -ldflags "-X github.com/akiyosi/goneovim/editor.Version=${{ steps.version-macos-11.outputs.GONEOVIM_VERSION }}" build desktop
cp -pR ../../runtime ./deploy/darwin/goneovim.app/Contents/Resources/
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/
/usr/libexec/PlistBuddy -c "Add :CFBundleVersion string ${{ steps.version-macos-11.outputs.GONEOVIM_VERSION_HASH }}" "./cmd/goneovim/deploy/darwin/goneovim.app/Contents/Info.plist"
/usr/libexec/PlistBuddy -c "Add :CFBundleShortVersionString string ${{ steps.version-macos-11.outputs.GONEOVIM_VERSION }}" "./cmd/goneovim/deploy/darwin/goneovim.app/Contents/Info.plist"
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy/darwin/goneovim.app/Contents/Frameworks/
rm -fr QtQuick.framework
rm -fr QtVirtualKeyboard.framework
- name: Archive
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy
mv darwin goneovim-macos
tar -jcvf goneovim-macos.tar.bz2 goneovim-macos
- name: Upload
uses: actions/upload-artifact@v1
with:
name: goneovim-macos
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy/goneovim-macos.tar.bz2
publish:
needs: [linux, archlinux, windows, macos]
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gettext-base
- if: github.event_name == 'workflow_dispatch'
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
- if: github.event_name == 'schedule'
run: echo 'TAG_NAME=nightly' >> $GITHUB_ENV
- if: github.event_name == 'push'
run: |
TAG_NAME=${{ github.ref }}
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV
- if: env.TAG_NAME == 'nightly'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
(echo 'SUBJECT=Goneovim Nightly build';
echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV
gh release delete nightly --yes || true
git push origin :nightly || true
- if: env.TAG_NAME != 'nightly'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
(echo "SUBJECT=Goneovim $TAG_NAME";
echo 'PRERELEASE=') >> $GITHUB_ENV
- name: Publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create $TAG_NAME $PRERELEASE --title "$SUBJECT" --target $GITHUB_SHA /home/runner/work/goneovim/goneovim/goneovim-macos/* /home/runner/work/goneovim/goneovim/goneovim-linux/* /home/runner/work/goneovim/goneovim/goneovim-archlinux/* /home/runner/work/goneovim/goneovim/goneovim-windows/*