forked from qutescoop/qutescoop
-
Notifications
You must be signed in to change notification settings - Fork 0
272 lines (266 loc) · 9.23 KB
/
build.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
name: Build and release
on:
push:
pull_request:
jobs:
facts:
outputs:
describe: ${{ steps.gather.outputs.describe }}
branch: ${{ steps.gather.outputs.branch }}
branch2: ${{ steps.gather.outputs.branch2 }}
pr: ${{ steps.gather.outputs.pr }}
version: ${{ steps.gather.outputs.version }}
commitLog: ${{ steps.gather.outputs.commitLog }}
runs-on: ubuntu-20.04
steps:
- name: inputs
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT"
env | sort
- uses: actions/checkout@v2
with:
fetch-depth: 0
- id: gather
name: gather
run: |
describe=$(git describe --tags --exclude '*-*-*' --dirty --always --debug)
echo ::set-output name=describe::$describe
branch=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo ::set-output name=branch::$branch
branch2=$(git rev-parse --abbrev-ref HEAD)
echo ::set-output name=branch2::$branch2
pr=${{ github.event.number }}
echo ::set-output name=pr::$pr
if [ -z "$pr" ]; then
echo ::set-output name=version::$describe
else
echo ::set-output name=version::$describe-pr$pr
fi
commitLog=$(git log "$(git describe --tags --abbrev=0 --exclude '*-*-*' HEAD~1)"..HEAD --format='%h - %s (%an)')
# Github multiline var workaround
commitLog="${commitLog//'%'/'%25'}"
commitLog="${commitLog//$'\n'/'%0A'}"
commitLog="${commitLog//$'\r'/'%0D'}"
echo ::set-output name=commitLog::"$commitLog"
- name: outputs
run: |
echo describe="${{ steps.gather.outputs.describe }}"
echo branch="${{ steps.gather.outputs.branch }}"
echo branch2="${{ steps.gather.outputs.branch2 }}"
echo pr="${{ steps.gather.outputs.pr }}"
echo version="${{ steps.gather.outputs.version }}"
echo commitLog="${{ steps.gather.outputs.commitLog }}"
build-linux:
needs: facts
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: sudo DEBIAN_FRONTEND=noninteractive apt-get update
- name: Install GLU
run: sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libglu1-mesa-dev
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ runner.os }}-QtCache
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.15.2'
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- run: ldd --version
- run: qmake -config release QuteScoop.pro
- run: make -j$(nproc) install
#- run: chmod +x ./DIST-unix64/QuteScoop ./DIST-unix64/QuteScoop.sh
- run: ldd ./DIST-unix64/QuteScoop
- run: mkdir ./DIST-unix64/lib
- name: package dynamically linked libraries (not really happy with that yet - this is by far not stable enough)
run: |
ldd ./DIST-unix64/QuteScoop \
| grep "=> /" \
| awk '{print $3}' \
| grep -E 'libQt|libgcc|libstdc|libicu|libGL|libxcb|libX' \
| xargs -I '{}' cp -v '{}' ./DIST-unix64/lib/
- name: package dynamically loaded libraries
run: |
cp "$Qt5_Dir"/lib/libQt5DBus.so.5 "$Qt5_Dir"/lib/libQt5XcbQpa.so.5 ./DIST-unix64/lib/
mkdir ./DIST-unix64/platforms
cp "$QT_PLUGIN_PATH"/platforms/libqxcb*.so* ./DIST-unix64/platforms
cp -ar "$QT_PLUGIN_PATH"/xcbglintegrations ./DIST-unix64/
- name: tgz
working-directory: DIST-unix64
run: |
mkdir ~/release
tar -cvzf ~/release/QuteScoop-${{ needs.facts.outputs.version }}-linux.tgz *
- name: Upload Makefile on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: "Debug_Linux-Makefile"
path: ./Makefile*
- name: Upload
uses: actions/upload-artifact@v2
with:
name: QuteScoop-linux
path: ~/release/*
build-win:
needs: facts
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ runner.os }}-5152-win64_msvc2019_64-QtCache
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: 5.15.2
arch: win64_msvc2019_64
modules: qtwebglplugin
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- run: env
shell: bash
- name: qmake
run: |
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
${{ env.Qt5_DIR }}\bin\qmake.exe -config release QuteScoop.pro
shell: cmd
- name: nmake install
run: |
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
nmake.exe install
shell: cmd
- name: windeployqt
working-directory: DIST-win64
run: |
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
${{ env.Qt5_DIR }}/bin/windeployqt.exe .
shell: cmd
- name: Upload Makefile on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: "Debug_Win-Makefile"
path: ./Makefile*
- name: zip
working-directory: DIST-win64
run: |
mkdir ~/release
Compress-Archive -Path * -DestinationPath ~/release/QuteScoop-${{ needs.facts.outputs.version }}-win.zip
- name: Upload
uses: actions/upload-artifact@v2
with:
name: QuteScoop-win
path: ~/release/*
build-mac:
needs: facts
runs-on: macos-11
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ runner.os }}-QtCache
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.15.2'
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- run: qmake -config release QuteScoop.pro
- run: make install
- name: Upload Makefile on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: "Debug_macos-${{ needs.facts.outputs.version }}-Makefile"
path: ./Makefile*
- name: zip
run: |
mkdir ~/release/
cd ./DIST-macx64
zip -9 -y -r ~/release/QuteScoop-${{ needs.facts.outputs.version }}-macos.zip .
- name: Upload
uses: actions/upload-artifact@v2
with:
name: QuteScoop-macos
path: ~/release/*
release:
needs:
- build-linux
- build-win
- build-mac
- facts
# Without workarounds (cron) we are not able to do any changes to this repo in a PR context :(
if: github.event_name != 'pull_request'
runs-on: ubuntu-20.04
outputs:
releaseId: ${{ steps.draftrelease.outputs.id }}
releaseUrl: ${{ steps.draftrelease.outputs.html_url }}
steps:
- name: inputs
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
NEEDS: ${{ toJson(needs) }}
run: |
echo "$GITHUB_CONTEXT"
echo "$NEEDS"
- uses: actions/download-artifact@v2
with:
path: release/
- run: ls -lhR release/
- name: draft release
id: draftrelease
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "release/*/QuteScoop-*"
body: ${{ needs.facts.outputs.commitLog }}
commit: ${{ github.sha }}
draft: true
generateReleaseNotes: true
name: ${{ needs.facts.outputs.version }}
prerelease: ${{ github.ref_type != 'tag' }}
tag: ${{ needs.facts.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
# - name: "publish release (if pre-release)"
# # the "draft first" shall inhibit watcher emails until artifacts are uploaded
# if: ${{ github.ref_type != 'tag' }}
# uses: ncipollo/release-action@v1
# with:
# allowUpdates: true
# commit: ${{ github.sha }}
# draft: false
# name: ${{ needs.facts.outputs.version }}
# omitBodyDuringUpdate: true
# omitNameDuringUpdate: true
# omitPrereleaseDuringUpdate: true
# prerelease: ${{ github.ref_type != 'tag' }}
# tag: ${{ needs.facts.outputs.version }}
# token: ${{ secrets.GITHUB_TOKEN }}
- name: delete potential stray release
uses: dev-drprasad/[email protected]
if: failure()
with:
delete_release: true
tag_name: ${{ needs.facts.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: output
run: |
echo "release URL: ${{ steps.draftrelease.outputs.html_url }}"
echo "release ID: ${{ steps.draftrelease.outputs.id }}"