-
Notifications
You must be signed in to change notification settings - Fork 2
267 lines (238 loc) · 8.59 KB
/
matrix.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
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
name: Build
on:
push:
pull_request:
release:
types: [published]
schedule:
- cron: '30 3 * * 0'
env:
TAG: ${{ github.ref }}
jobs:
# Common Build matrix for builds on Ubuntu VM
ubuntu_build:
name: ${{ matrix.build_name }}
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
# Add more compilers here if you need them
build_name: ['Ubuntu GCC 7', 'Ubuntu GCC 8', 'Ubuntu Clang 6']
include:
- build_name: 'Ubuntu GCC 7'
package_name: 'gcc-7 g++-7'
cc: gcc-7
cxx: g++-7
label: linux-gcc-7
deployable: true
- build_name: 'Ubuntu GCC 8'
package_name: 'gcc-8 g++-8'
cc: gcc-8
cxx: g++-8
label: linux
deployable: true
- build_name: 'Ubuntu Clang 6'
cc: clang-6.0
cxx: clang++-6.0
label: linux-clang-6
deployable: true
env:
CCACHE_DIR: $GITHUB_WORKSPACE/.ccache
LABEL: ${{ matrix.label }}
steps:
- uses: actions/checkout@v1
# Fetch Dependencies
- name: Dependencies
if: matrix.build_name != 'aarch64'
run: |
sudo apt update
sudo apt install -y libboost-all-dev libssl-dev ${{ matrix.package_name }}
- name: Setup ccache
run: |
sudo apt install ccache
- name: Retrieve ccache
uses: actions/cache@v1
with:
path: .ccache
key: ccache-${{ matrix.label }}
# Configure the project with cmake
- name: Configure
if: matrix.build_name != 'aarch64'
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
mkdir build && cd build
cmake -DBUILD_ALL:BOOL=TRUE ..
# Build for linux
- name: Build
if: matrix.build_name != 'aarch64'
run: |
cd build
cmake --build . --config Release
# Prepare for deploy
- name: Prepare for Deploy
id: before_deploy
env:
COMMIT_SHA: ${{ github.sha }}
run: |
if [[ "${TAG:5:4}" == "tags" ]]; then export TAG=${TAG:10}; else export TAG=${COMMIT_SHA::8}; fi
cd build/src
TARGETS="qwertyforkd simplewallet walletd"
if [[ "${LABEL}" != "aarch64" ]]; then strip ${TARGETS}; fi
rm -rf qwertyfork-${TAG}
mkdir qwertyfork-${TAG}
cp ${TARGETS} qwertyfork-${TAG}/
cp ../../LICENSE.txt qwertyfork-${TAG}/
tar cvfz qwertyfork-${LABEL}-${TAG}.tar.gz qwertyfork-${TAG}/
echo ::set-output name=binary_path::qwertyfork-${TAG}
echo ::set-output name=artifact_name::qwertyfork-${LABEL}-${TAG}
echo ::set-output name=file_name::qwertyfork-${LABEL}-${TAG}.tar.gz
# Upload to GH Release
- name: Upload to GH Release
if: github.event_name == 'release' && matrix.deployable
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/src/${{ steps.before_deploy.outputs.file_name }}
asset_name: ${{ steps.before_deploy.outputs.file_name }}
asset_content_type: application/gzip
# Upload to GH Actions Artifacts
- name: Upload To GH Artifacts
uses: actions/upload-artifact@v1.0.0
with:
name: ${{ steps.before_deploy.outputs.artifact_name }}
path: ./build/src/${{ steps.before_deploy.outputs.binary_path }}
# Mac builds on Catalina VM
macos_build:
name: macOS
runs-on: macOS-latest
env:
CC: /usr/local/opt/llvm@8/bin/clang
CXX: /usr/local/opt/llvm@8/bin/clang++
LABEL: osx
CCACHE_DIR: $GITHUB_WORKSPACE/.ccache
steps:
- uses: actions/checkout@v1
# Fetch Dependencies
- name: Dependencies
run: |
brew install --force boost llvm@8 ccache
brew link --overwrite llvm@8
ln -s /usr/local/opt/llvm@8 /usr/local/opt/llvm
- name: Retrieve ccache
uses: actions/cache@v1
with:
path: .ccache
key: ccache-osx
# Configure project with cmake
- name: Configure
run: |
mkdir build && cd build
cmake -DBUILD_ALL:BOOL=TRUE ..
# Build for macOS
- name: Build
run: |
cd build
cmake --build . --config Release
# Prepare for deploy
- name: Prepare for Deploy
id: before_deploy
env:
COMMIT_SHA: ${{ github.sha }}
run: |
if [[ "${TAG:5:4}" == "tags" ]]; then export TAG=${TAG:10}; else export TAG=${COMMIT_SHA::8}; fi
cd build/src
TARGETS="qwertyforkd simplewallet walletd"
strip ${TARGETS}
rm -rf qwertyfork-${TAG}
mkdir qwertyfork-${TAG}
cp ${TARGETS} qwertyfork-${TAG}/
cp ../../LICENSE.txt qwertyfork-${TAG}/
tar cvfz qwertyfork-${LABEL}-${TAG}.tar.gz qwertyfork-${TAG}/
echo ::set-output name=binary_path::qwertyfork-${TAG}
echo ::set-output name=artifact_name::qwertyfork-${LABEL}-${TAG}
echo ::set-output name=file_name::qwertyfork-${LABEL}-${TAG}.tar.gz
# Upload to GH Release
- name: Upload to GH Release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/src/${{ steps.before_deploy.outputs.file_name }}
asset_name: ${{ steps.before_deploy.outputs.file_name }}
asset_content_type: application/gzip
# Upload to GH Actions Artifacts
- name: Upload To GH Artifacts
uses: actions/upload-artifact@v1.0.0
with:
name: ${{ steps.before_deploy.outputs.artifact_name }}
path: ./build/src/${{ steps.before_deploy.outputs.binary_path }}
# Windows Builds on Windows Server 2019
windows_build:
name: Windows
runs-on: windows-latest
env:
LABEL: windows
steps:
- uses: actions/checkout@v1
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Setup clcache
run: pip install clcache
- name: Retrieve clcache
uses: actions/cache@v1
with:
path: clcache
key: clcache-windows
# Configure project with cmake
- name: Configure
run: |
mkdir build
cd build
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION="10.0.18362.0" -DBUILD_ALL:BOOL=TRUE ..
# Build for Windows
- name: Build
run: |
$env:CLCACHE_DIR = "$env:GITHUB_WORKSPACE\clcache"
$env:PATH = "$env:PATH;$env:MSBUILD_PATH"
cd build
cmake --build . --config Release
# Prepare for deploy
- name: Prepare for Deploy
shell: bash
id: before_deploy
env:
COMMIT_SHA: ${{ github.sha }}
run: |
if [[ "${TAG:5:4}" == "tags" ]]; then export TAG=${TAG:10}; else export TAG=${COMMIT_SHA::8}; fi
cd build/src/Release
rm -rf qwertyfork-${TAG}
mkdir qwertyfork-${TAG}
cp *.exe qwertyfork-${TAG}/
cp ../../../LICENSE.txt qwertyfork-${TAG}/
7z a qwertyfork-${LABEL}-${TAG}.zip qwertyfork-${TAG}/
echo ::set-output name=binary_path::qwertyfork-${TAG}
echo ::set-output name=artifact_name::qwertyfork-${LABEL}-${TAG}
echo ::set-output name=file_name::qwertyfork-${LABEL}-${TAG}.zip
# Upload to GH Release
- name: Upload to GH Release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/src/Release/${{ steps.before_deploy.outputs.file_name }}
asset_name: ${{ steps.before_deploy.outputs.file_name }}
asset_content_type: application/zip
# Upload to GH Actions Artifacts
- name: Upload To GH Artifacts
uses: actions/upload-artifact@v1.0.0
with:
name: ${{ steps.before_deploy.outputs.artifact_name }}
path: ./build/src/Release/${{ steps.before_deploy.outputs.binary_path }}