-
Notifications
You must be signed in to change notification settings - Fork 0
239 lines (198 loc) · 7.76 KB
/
build.yml
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
name: Build
on:
push:
tags:
- 'v*'
branches:
- main
pull_request:
branches:
- main
env:
BUILD_TYPE: Release
jobs:
ubuntu-20_04-build:
name: Build (Ubuntu 20.04)
runs-on: ubuntu-20.04
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Cache compilation (ccache)
uses: hendrikmuhs/ccache-action@v1
- 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: 6.2.6
modules: qtcharts
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ubuntu-20_04-exe
path: ${{github.workspace}}/build
ubuntu-20_04-appimage:
name: AppImage (Ubuntu 20.04)
runs-on: ubuntu-20.04
needs: ubuntu-20_04-build
steps:
- name: Checkout source
uses: actions/checkout@v2
- 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: 6.2.6
modules: qtcharts
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: ubuntu-20_04-exe
path: ${{github.workspace}}/build
- name: Install linuxdeployqt and dependencies
run: |
wget -q https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod +x linuxdeployqt-continuous-x86_64.AppImage
sudo apt-get install -y zsync libgstreamer-plugins-base1.0-0
- name: Create AppDir
run: |
mkdir -p /tmp/AppDir/usr/bin
mkdir -p /tmp/AppDir/usr/lib
mkdir -p /tmp/AppDir/usr/share/applications
mkdir -p /tmp/AppDir/usr/share/icons/hicolor/512x512/apps
cp ${{github.workspace}}/build/src/gui/babblesynth-gui /tmp/AppDir/usr/bin/babblesynth
chmod +x /tmp/AppDir/usr/bin/babblesynth
cp ${{github.workspace}}/babblesynth.desktop /tmp/AppDir/usr/share/applications/babblesynth.desktop
cp ${{github.workspace}}/branding/icon_512x512.png /tmp/AppDir/usr/share/icons/hicolor/512x5w12/apps/babblesynth.png
tree /tmp/AppDir
- name: Get version name
id: get_version
run: |
if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then
echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
echo ::set-output name=release::BabbleSynth ${GITHUB_REF/refs\/tags\//}
else
echo ::set-output name=version::continuous
echo ::set-output name=release::Continuous build
fi
- name: Build AppImage with linuxdeployqt
run: |
export VERSION=${{ steps.get_version.outputs.version }}
export UPDATE_INFO="gh-releases-zsync|clo-yunhee|babblesynth|${{ steps.get_version.outputs.release }}|BabbleSynth-*x86_64.AppImage.zsync"
./linuxdeployqt-continuous-x86_64.AppImage /tmp/AppDir/usr/share/applications/babblesynth.desktop -appimage -updateinformation="$UPDATE_INFO"
ls -alF ${{github.workspace}}
- name: Rename artifacts
run: |
mv ${{github.workspace}}/BabbleSynth*.AppImage ${{github.workspace}}/BabbleSynth-${{ steps.get_version.outputs.version }}-linux-x86_64.AppImage
mv ${{github.workspace}}/BabbleSynth*.AppImage.zsync ${{github.workspace}}/BabbleSynth-${{ steps.get_version.outputs.version }}-linux-x86_64.AppImage.zsync
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: linux-appimage
path: |
${{github.workspace}}/BabbleSynth-${{ steps.get_version.outputs.version }}-linux-x86_64.AppImage
${{github.workspace}}/BabbleSynth-${{ steps.get_version.outputs.version }}-linux-x86_64.AppImage.zsync
windows-2019-build:
name: Build (Windows Server 2019)
runs-on: windows-2019
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Download ccache
id: ccache
shell: cmake -P {0}
run: |
set(ccache_url "https://github.com/cristianadam/ccache/releases/download/v4.5/Windows.tar.xz")
file(DOWNLOAD "${ccache_url}" ./ccache.tar.xz SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ccache.tar.xz)
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: Cache ccache files
uses: actions/[email protected]
with:
path: .ccache
key: ${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: ${{ matrix.config.name }}-ccache-
- 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: 6.2.6
modules: qtcharts
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Get version name
id: get_version
run: |
if ("${{ startsWith(github.ref, 'refs/tags/') }}" -eq "true") {
$tag_name = ${env:GITHUB_REF} -replace 'refs/tags/', ''
Write-Output "::set-output name=version::$tag_name"
}
else {
Write-Output "::set-output name=version::continuous"
}
- name: ccache statistics
shell: cmake -P {0}
run: |
file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}" ccache_basedir)
set(ENV{CCACHE_BASEDIR} "${ccache_basedir}")
set(ENV{CCACHE_DIR} "${ccache_basedir}/.ccache")
execute_process(COMMAND ccache -s)
- name: Make package
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target package
- name: Rename artifacts
run: mv ${{github.workspace}}/build/BabbleSynth*.exe ${{github.workspace}}/BabbleSynth-${{ steps.get_version.outputs.version }}-windows-x86_64.exe
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: windows-installer
path: ${{github.workspace}}/BabbleSynth-${{ steps.get_version.outputs.version }}-windows-x86_64.exe
create-gh-release:
name: Create GitHub release
runs-on: ubuntu-latest
needs:
- ubuntu-20_04-appimage
- windows-2019-build
steps:
- name: Download AppImage artifacts
uses: actions/download-artifact@v2
with:
name: linux-appimage
- name: Download Windows artifacts
uses: actions/download-artifact@v2
with:
name: windows-installer
- name: Create release and upload assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
chmod +x pyuploadtool-x86_64.AppImage
./pyuploadtool-x86_64.AppImage ${{github.workspace}}/BabbleSynth-*