-
Notifications
You must be signed in to change notification settings - Fork 24
286 lines (254 loc) · 14.2 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
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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
name: Build
on: [push]
env:
BUILD_TYPE: Release
BUILD_CONFIG: RelWithDebInfo
BEAM_DEFAULT_NETWORK: mainnet
jobs:
###############################################################################
# Build Desktop
###############################################################################
build_desktop:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12, ubuntu-20.04, windows-2019]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Submodule update
shell: bash
run: |
git submodule update --init --recursive --jobs 4
cd beam
git apply 3rdparty/protobuf-patch.diff
###############################################################################
# Create Build Environment
###############################################################################
- name: OS name [macos && windows]
shell: bash
if: startsWith(matrix.os, 'macos') || matrix.os == 'windows-2019'
run: echo "PACKAGE_NAME=${{runner.os}}" >> $GITHUB_ENV
- name: OS name [ununtu all]
shell: bash
if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
run: echo "PACKAGE_NAME=Linux" >> $GITHUB_ENV
- name: Create Build Environment [macos]
if: startsWith(matrix.os, 'macos')
run: |
echo $GITHUB_WORKSPACE
echo "OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1" >> $GITHUB_ENV
export TZ=GMT-3
sudo systemsetup -gettimezone
security create-keychain -p github macos-build.keychain
security default-keychain -s macos-build.keychain
security unlock-keychain -p github macos-build.keychain
security set-keychain-settings -t 3600 -l ~/Library/Keychains/macos-build.keychain
echo "${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}" | base64 --decode > certificate.p12
security import certificate.p12 -k macos-build.keychain -P ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k github macos-build.keychain
- name: Create Build Environment [ununtu all]
shell: bash
if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
run: |
sudo apt update
sudo apt install build-essential -y
sudo apt install libssl-dev curl libcups2-dev mesa-common-dev ^libxcb.* libglu1-mesa-dev libglfw3-dev libgles2-mesa-dev libfontconfig1-dev libudev-dev -y
sudo apt install libfreetype6-dev libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxkbcommon-dev libxkbcommon-x11-dev libpci-dev libicu-dev -y
sudo apt install libwebp-dev libzstd-dev libbsd-dev uuid-dev liblzma-dev libtiff-dev -y
- name: Create Build Environment [ubuntu 16.04]
shell: bash
if: matrix.os == 'ubuntu-16.04'
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --set gcc "/usr/bin/gcc-7"
- name: Create Build Environment [windows]
shell: bash
if: matrix.os == 'windows-2019'
run: |
git clone --depth=1 https://github.com/BeamMW/libs.git c:/beam-libs
echo "OPENSSL_ROOT_DIR=c:\beam-libs\openssl" >> $GITHUB_ENV
git clone https://github.com/BeamMW/boost_prebuild_${{matrix.os}}.git c:/boost_prebuild
echo "BOOST_ROOT=c:\boost_prebuild" >> $GITHUB_ENV
- name: Download boost [ubuntu && macos]
if: matrix.os != 'windows-2019'
shell: bash
run: |
git clone --depth=1 https://github.com/BeamMW/boost_prebuild_${{matrix.os}}.git ${{runner.workspace}}/boost_prebuild
echo "BOOST_INCLUDEDIR=${{runner.workspace}}/boost_prebuild/include" >> $GITHUB_ENV
echo "BOOST_LIBRARYDIR=${{runner.workspace}}/boost_prebuild/lib/" >> $GITHUB_ENV
###############################################################################
# Install Qt5
###############################################################################
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ matrix.os }}-QtCache
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
#version: "5.15.2"
modules: "qtwebengine"
cached: ${{ steps.cache-qt.outputs.cache-hit }}
###############################################################################
# Configure CMake
###############################################################################
- name: Configure CMake [macos]
if: startsWith(matrix.os, 'macos')
run: |
cmake $GITHUB_WORKSPACE -DBEAM_DEFAULT_NETWORK=$BEAM_DEFAULT_NETWORK -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDEBUG_MESSAGES_IN_RELEASE_MODE=On -DBEAM_LINK_TYPE=Static -DBEAM_USE_STATIC_QT=FALSE -DBRANCH_NAME=${GITHUB_REF##*/} -DBEAM_SIGN_MACOS_BINARY=On -DBEAM_SIGN_IDENTITY="${{secrets.MACOS_SIGN_IDENTITY}}" -DBEAM_HW_WALLET=Off .
- name: Configure CMake [ununtu all]
if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
run: |
cmake $GITHUB_WORKSPACE -DBEAM_DEFAULT_NETWORK=$BEAM_DEFAULT_NETWORK -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=/usr -DDEBUG_MESSAGES_IN_RELEASE_MODE=On -DBEAM_LINK_TYPE=Static -DBEAM_USE_STATIC_QT=FALSE -DBRANCH_NAME=${GITHUB_REF##*/} -DBEAM_HW_WALLET=Off .
- name: Configure CMake [windows]
shell: bash
if: matrix.os == 'windows-2019'
run: |
cmake -G "Visual Studio 16 2019" -A x64 -DBEAM_DEFAULT_NETWORK=$BEAM_DEFAULT_NETWORK -DOPENSSL_ROOT_DIR=/c/beam-libs/openssl -DCMAKE_CONFIGURATION_TYPES:STRING=$BUILD_CONFIG -DBEAM_LINK_TYPE=Static -DBEAM_USE_STATIC_QT=FALSE -DBRANCH_NAME=${GITHUB_REF##*/} -DBEAM_HW_WALLET=Off .
- name: Save version info
shell: bash
run: |
echo "BEAM_VERSION=$(cat beam_version.gen)" >> $GITHUB_ENV
echo "BEAM_TARGET_SUFFIX=" >> $GITHUB_ENV
echo "BEAM_DISPLAY_SUFFIX=" >> $GITHUB_ENV
echo "BEAM_DISPLAY_SUFFIX2=" >> $GITHUB_ENV
echo "BEAM_DISPLAY_SUFFIX3=" >> $GITHUB_ENV
echo "BEAM_DISPLAY_SUFFIX4=" >> $GITHUB_ENV
rm beam_version.gen
###############################################################################
# Build
###############################################################################
- name: Build [macos]
if: startsWith(matrix.os, 'macos')
run: cmake --build . --parallel --config $BUILD_TYPE
- name: Build [ununtu all]
shell: bash
if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
run: make -j$(nproc)
- name: Build [windows]
shell: bash
if: matrix.os == 'windows-2019'
run: cmake --build . --config $BUILD_CONFIG --parallel
###############################################################################
# Pack
###############################################################################
- name: CPack [macos && ununtu all]
if: matrix.os != 'windows-2019'
run: cpack
- name: AppImage [ubuntu-16.04 || ubuntu-18.04 || ubuntu-20.04]
if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
run: |
echo "Creating AppImage deploy tree"
mkdir -p ./deploy/usr/bin
mkdir -p ./deploy/usr/share/applications
mkdir -p ./deploy/usr/share/icons/hicolor/256x256/apps
mkdir -p ./deploy/usr/share/icons/hicolor/256x256/mimetypes
mkdir -p ./deploy/usr/share/mime/packages
echo "Copying files to AppImage deploy tree"
cp ui/BeamWallet${{env.BEAM_DISPLAY_SUFFIX}} deploy/usr/bin/
cp ui/dapps_store_app.wasm deploy/usr/bin/
cp -r ui/apps deploy/usr/bin/
cp ui/beam.png deploy/usr/share/icons/hicolor/256x256/apps/
cp ui/beam.png deploy/usr/share/icons/hicolor/256x256/mimetypes/application-x-beam-dapp.png
cp ui/x-beam-dapp.xml deploy/usr/share/mime/packages
cp ui/beam.desktop deploy/usr/share/applications/BeamWallet${{env.BEAM_DISPLAY_SUFFIX}}.desktop
cp ui/beam-wallet.cfg deploy/usr/bin/
echo "Creating AppImage"
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt*.AppImage
export VERSION=${{env.BEAM_VERSION}}
# Below -exclude-libs is a work around for https://github.com/probonopd/linuxdeployqt/issues/35
./linuxdeployqt*.AppImage ./deploy/usr/share/applications/BeamWallet${{env.BEAM_DISPLAY_SUFFIX}}.desktop -appimage -no-translations -always-overwrite -qmldir="./ui/view" -no-copy-copyright-files -exclude-libs="libnss3.so,libnssutil3.so"
- name: CPack [windows]
shell: bash
if: matrix.os == 'windows-2019'
run: cpack.exe --verbose -G NSIS -C $BUILD_CONFIG
###############################################################################
# Collect artifacts
###############################################################################
- name: Collect [macos]
shell: bash
if: startsWith(matrix.os, 'macos')
run: |
cp BeamWallet${{env.BEAM_DISPLAY_SUFFIX}}-${{env.BEAM_VERSION}}-Darwin.dmg Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}.dmg
codesign --deep --force -v -s "${{secrets.MACOS_SIGN_IDENTITY}}" -o runtime --timestamp Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}.dmg
- name: Notarize [macos]
shell: bash
if: startsWith(matrix.os, 'macos')
env:
MACOS_NOTARIZE_USER: ${{ secrets.MACOS_NOTARIZE_USER }}
MACOS_NOTARIZE_PASS: ${{ secrets.MACOS_NOTARIZE_PASS }}
MACOS_NOTARIZE_PROVIDER: ${{ secrets.MACOS_NOTARIZE_PROVIDER }}
BEAM_WALLET_UI_IN: Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}.dmg
run: |
chmod +x ./notarize.sh
./notarize.sh
shasum -a 256 Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}.dmg > checksum.txt
- name: Configure GPG Key [ubuntu]
shell: bash
if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
run: |
echo -n "$GPG_SIGNING_KEY" | gpg2 --import
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
- name: Sign AppImage [ubuntu]
shell: bash
if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
run: |
mkdir signing
cd signing
# Download AppImageTool
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
sudo chmod +x appimagetool-x86_64.AppImage
cp ../Beam_Wallet${{env.BEAM_DISPLAY_SUFFIX4}}-${{env.BEAM_VERSION}}-x86_64.AppImage .
# Extract, sign and pack AppImage
./Beam_Wallet${{env.BEAM_DISPLAY_SUFFIX4}}-${{env.BEAM_VERSION}}-x86_64.AppImage --appimage-extract
./appimagetool-x86_64.AppImage squashfs-root --sign
mv Beam_Wallet${{env.BEAM_DISPLAY_SUFFIX4}}-x86_64.AppImage ../Beam_Wallet${{env.BEAM_DISPLAY_SUFFIX4}}-${{env.BEAM_VERSION}}-x86_64.AppImage
# Output signature
../Beam_Wallet${{env.BEAM_DISPLAY_SUFFIX4}}-${{env.BEAM_VERSION}}-x86_64.AppImage --appimage-signature
- name: Collect [ubuntu]
shell: bash
if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
run: |
#cp BeamWallet${{env.BEAM_DISPLAY_SUFFIX}}-${{env.BEAM_VERSION}}-Linux.deb Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}.deb
#sha256sum Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}.deb > checksum.txt
cp Beam_Wallet${{env.BEAM_DISPLAY_SUFFIX4}}-${{env.BEAM_VERSION}}-x86_64.AppImage Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}.AppImage
sha256sum Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}.AppImage > Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}.AppImage-checksum.txt
chmod a+x Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}.AppImage
- name: Collect [windows]
shell: bash
if: matrix.os == 'windows-2019'
run: |
cp BeamWallet${{env.BEAM_DISPLAY_SUFFIX}}-${{env.BEAM_VERSION}}-win64.exe Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}.exe
certUtil -hashfile Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}.exe SHA256 > checksum.txt
###############################################################################
# Upload
###############################################################################
- uses: actions/upload-artifact@v4
if: matrix.os == 'windows-2019' || startsWith(matrix.os, 'macos')
with:
name: ${{env.PACKAGE_NAME}}-Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}
path: |
Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}*
*checksum.txt
if-no-files-found: error
- uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
with:
name: ${{env.PACKAGE_NAME}}-Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}
path: Beam-Wallet${{env.BEAM_DISPLAY_SUFFIX2}}-${{env.BEAM_VERSION}}.AppImage
if-no-files-found: error
- uses: actions/upload-artifact@v4
if: matrix.os == 'windows-2019'
with:
name: beam-pdb${{env.BEAM_TARGET_SUFFIX}}-${{env.BEAM_VERSION}}
path: ui/${{env.BUILD_CONFIG}}/Beam Wallet${{env.BEAM_DISPLAY_SUFFIX3}}.pdb
if-no-files-found: error