8
8
# CMake build type (Release, Debug, RelWithDebInfo, etc.)
9
9
BUILD_TYPE : Release
10
10
11
+
11
12
jobs :
12
13
build_check :
13
14
strategy :
14
15
# do not stop on 1st fail
15
16
fail-fast : false
16
17
matrix :
17
- # GitHub hosted runners do not support Qt on Windows
18
18
# use Ubuntu1804 until Debian "bullseye" becomes "stable"
19
19
os : [ubuntu-18.04, macos-10.15, windows-2019]
20
20
21
21
runs-on : ${{ matrix.os }}
22
22
23
+
23
24
steps :
24
25
26
+
27
+ # --- Clone the latest commit ---
28
+
25
29
- name : Checkout
26
30
uses : actions/checkout@v2
27
31
28
32
33
+ # --- Linux (Ubuntu) steps ---
34
+
29
35
- name : Install Ubuntu Build Requirements
30
36
if : startsWith(matrix.os, 'ubuntu')
31
37
run :
@@ -36,23 +42,28 @@ jobs:
36
42
cp ../CHANGELOG changelog;
37
43
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
38
44
45
+
39
46
- name : Ubuntu Build
40
47
# GitHub hosts Linux runners on Standard_DS2_v2 virtual machines in Microsoft Azure:
41
48
# 2-core CPU, 7 GB of RAM memory, 14 GB of SSD disk space
42
49
working-directory : ${{github.workspace}}/build
43
50
if : startsWith(matrix.os, 'ubuntu')
44
51
run :
45
52
make -j8;
46
- fakeroot make -j8 package
53
+ fakeroot make -j8 package;
54
+ ls -l packages
55
+
47
56
48
57
- name : Upload Ubuntu Artifacts
58
+ # *.deb *.rpm *.tgz
49
59
if : startsWith(matrix.os, 'ubuntu')
50
60
uses : actions/upload-artifact@v2
51
61
with :
52
62
name : openhantek_linux_amd64_${{github.run_number}}
53
63
path : ${{github.workspace}}/build/packages/
54
64
55
65
66
+ # --- macOS steps ---
56
67
57
68
- name : Install macOS Build Requirements
58
69
if : startsWith(matrix.os, 'macos')
65
76
cp ../CHANGELOG changelog;
66
77
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH=${Qt5_DIR}
67
78
79
+
68
80
- name : macOS Build
69
81
# GitHub hosts macOS runners in GitHub's own macOS Cloud:
70
82
# 3-core CPU, 14 GB of RAM memory, 14 GB of SSD disk space
91
103
if test -f OpenHantek.dmg; then
92
104
sudo mv OpenHantek.dmg ../packages/$(basename ../packages/openhantek_*_osx_*.tar.gz .tar.gz).dmg;
93
105
fi;
94
- cd ..;
106
+ cd ..;
107
+ ls -l packages;
95
108
else true;
96
109
fi
97
110
@@ -104,49 +117,52 @@ jobs:
104
117
path : ${{github.workspace}}/build/packages/*.dmg
105
118
106
119
120
+ # --- Windows steps ---
107
121
108
122
- name : Install Qt for Windows
109
123
if : startsWith(matrix.os, 'windows')
110
124
uses : jurplel/install-qt-action@v2
111
125
126
+
112
127
- name : Install Windows Build Requirements
113
128
if : startsWith(matrix.os, 'windows')
114
129
run :
115
130
md build &
116
131
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" &
117
132
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_PREFIX_PATH=%Qt5_DIR% -DCMAKE_BUILD_TYPE=Release -Bbuild
118
133
134
+
119
135
- name : Windows Build
120
136
# GitHub hosts Windows runners on Standard_DS2_v2 virtual machines in Microsoft Azure:
121
137
# 2-core CPU, 7 GB of RAM memory, 14 GB of SSD disk space
122
138
working-directory : ${{github.workspace}}/build
123
139
if : startsWith(matrix.os, 'windows')
140
+ shell : bash
124
141
run :
125
- cmake --build . --config Release --target package
142
+ cmake --build . --parallel 8 --config Release --target package;
143
+ ZIP=$(basename packages/openhantek_*_win_x64.zip);
144
+ rm -f packages/openhantek_*_win_x64.*;
145
+ cd openhantek/Release;
146
+ 7z a ../../packages/$ZIP *;
147
+ cd ../..;
148
+ ls -l packages;
126
149
127
150
128
151
- name : Upload Windows Artifacts
129
152
if : startsWith(matrix.os, 'windows')
130
153
uses : actions/upload-artifact@v2
131
154
with :
132
- name : OpenHantek_Win_x64_ ${{github.run_number}}
133
- path : ${{github.workspace}}/build/openhantek/Release
155
+ name : openhantek_win_x64_ ${{github.run_number}}
156
+ path : ${{github.workspace}}/build/packages/*.zip
134
157
135
158
159
+ # --- Tagged Commit -> Upload Release ---
136
160
137
- - name : Upload Linux / macOS Release Assets
161
+ - name : Upload Linux / macOS / Windows Release Assets
162
+ if : startsWith(github.ref, 'refs/tags/')
138
163
uses : softprops/action-gh-release@v1
139
- if : ${{ startsWith(github.ref, 'refs/tags/') && ( startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') ) }}
140
164
with :
141
165
files : ${{github.workspace}}/build/packages/*
142
166
env :
143
167
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
144
168
145
-
146
- - name : Upload Windows Release Assets
147
- uses : softprops/action-gh-release@v1
148
- if : ${{ startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'windows') }}
149
- with :
150
- files : ${{github.workspace}}/build/openhantek/Release/*
151
- env :
152
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments