-
Notifications
You must be signed in to change notification settings - Fork 19
240 lines (204 loc) · 7.43 KB
/
BuildAndRelease.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
240
name: Build and Release
on:
workflow_dispatch:
push:
branches:
- 'master'
env:
SOURCE_DIR: ${{ github.workspace }}
QT_VERSION: 6.2
permissions:
contents: write
jobs:
setup-env:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
outputs:
timestamp: ${{ steps.timestamp.outputs.TIMESTAMP }}
ck-version: ${{ steps.ck-version.outputs.CK_VERSION }}
steps:
- id: timestamp
run: |
echo "TIMESTAMP=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
- id: ck-version
run: |
echo "CK_VERSION=Automated-${{ steps.timestamp.outputs.TIMESTAMP }}" >> "$GITHUB_OUTPUT"
build-windows:
runs-on: windows-2019
needs: [setup-env]
defaults:
run:
shell: cmd
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
host: windows
target: desktop
arch: win64_msvc2019_64
dir: ${{ runner.temp }}
cache: 'true'
cache-key-prefix: 'install-qt-action-win'
setup-python: false
- name: Download JOM
uses: suisei-cn/[email protected]
with:
url: http://download.qt.io/official_releases/jom/jom.zip
target: ${{ runner.temp }}\
- name: Unzip JOM
working-directory: ${{ runner.temp }}
run: |
7z x jom.zip -ojom
- name: Set up Visual Studio shell
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: Build
working-directory: ${{ runner.temp }}
run: |
mkdir build
cd build
qmake ${{ env.SOURCE_DIR }}\CoinKiller.pro CK_VERSION=${{ needs.setup-env.outputs.ck-version }}
${{ runner.temp }}\jom\jom
- name: Deploy
working-directory: ${{ runner.temp }}
run: |
mkdir deploy
cd deploy
windeployqt --dir . ${{ runner.temp }}\build\release\CoinKiller.exe --release --no-translations --no-compiler-runtime
xcopy ${{ runner.temp }}\build\release\CoinKiller.exe .
xcopy ${{ env.SOURCE_DIR }}\coinkiller_data coinkiller_data\ /E
xcopy ${{ env.SOURCE_DIR }}\README.md .
xcopy ${{ env.SOURCE_DIR }}\LICENSE .
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: CoinKiller-Windows
path: ${{ runner.temp }}\deploy\
build-macos:
runs-on: macos-latest
needs: [setup-env]
defaults:
run:
shell: bash
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
host: mac
target: desktop
arch: clang_64
dir: ${{ runner.temp }}
cache: 'true'
cache-key-prefix: 'install-qt-action-macos'
setup-python: false
- name: Setup xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Build
working-directory: ${{ runner.temp }}
run: |
mkdir build
cd build
qmake ${{ env.SOURCE_DIR }}/CoinKiller.pro QMAKE_APPLE_DEVICE_ARCHS="x86_64 arm64" CK_VERSION=${{ needs.setup-env.outputs.ck-version }}
make -j1
- name: Deploy
working-directory: ${{ runner.temp }}/build/
run: |
cp -R ${{ env.SOURCE_DIR }}/coinkiller_data CoinKiller.app/Contents/MacOS/coinkiller_data
macdeployqt CoinKiller.app -dmg
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: CoinKiller-Macos
path: ${{ runner.temp }}/build/CoinKiller.dmg
build-linux:
runs-on: ubuntu-latest
needs: [setup-env]
defaults:
run:
shell: bash
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo add-apt-repository universe
sudo apt-get install -y qt6-base-dev libfuse2
- name: Setup Qt
run: |
qtchooser -install qt6 $(which qmake6)
sudo mv ~/.config/qtchooser/qt6.conf /usr/share/qtchooser/qt6.conf
sudo mkdir -p /usr/lib/$(uname -p)-linux-gnu/qt-default/qtchooser
sudo ln -n /usr/share/qtchooser/qt6.conf /usr/lib/$(uname -p)-linux-gnu/qt-default/qtchooser/default.conf
- name: Build
working-directory: ${{ runner.temp }}
run: |
mkdir build
cd build
qmake ${{ env.SOURCE_DIR }}/CoinKiller.pro CK_VERSION=${{ needs.setup-env.outputs.ck-version }}
make -j$(nproc)
make install INSTALL_ROOT=AppDir
- name: Deploy
working-directory: ${{ runner.temp }}
run: |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x linuxdeploy-plugin-qt-x86_64.AppImage
./linuxdeploy-x86_64.AppImage --appdir ${{ runner.temp }}/build/AppDir --plugin qt --output appimage
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: CoinKiller-Linux
path: ${{ runner.temp }}/CoinKiller-x86_64.AppImage
create-release:
runs-on: ubuntu-latest
needs: [setup-env, build-windows, build-macos, build-linux]
defaults:
run:
shell: bash
steps:
- name: Download artifacts (Windows)
uses: actions/download-artifact@v3
with:
name: CoinKiller-Windows
path: ${{ runner.temp }}/CoinKiller-Windows
- name: Download artifacts (Macos)
uses: actions/download-artifact@v3
with:
name: CoinKiller-Macos
path: ${{ runner.temp }}/CoinKiller-Macos
- name: Download artifacts (Linux)
uses: actions/download-artifact@v3
with:
name: CoinKiller-Linux
path: ${{ runner.temp }}/CoinKiller-Linux
- name: Zip artifact
working-directory: ${{ runner.temp }}
run: |
7z a CoinKiller-Windows-x86_64-${{ needs.setup-env.outputs.timestamp }}.zip ${{ runner.temp }}/CoinKiller-Windows/* -r
- name: Rename output Files
run: |
mv ${{ runner.temp }}/CoinKiller-Macos/CoinKiller.dmg ${{ runner.temp }}/CoinKiller-Macos/CoinKiller-MacOS-Universal-${{ needs.setup-env.outputs.timestamp }}.dmg
mv ${{ runner.temp }}/CoinKiller-Linux/CoinKiller-x86_64.AppImage ${{ runner.temp }}/CoinKiller-Linux/CoinKiller-Linux-x86_64-${{ needs.setup-env.outputs.timestamp }}.AppImage
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: Automated-${{ needs.setup-env.outputs.timestamp }}
generate_release_notes: true
body: Automated release created on ${{ needs.setup-env.outputs.timestamp }}
files: |
${{ runner.temp }}/*.zip
${{ runner.temp }}/CoinKiller-Macos/*.dmg
${{ runner.temp }}/CoinKiller-Linux/*.AppImage