Update build.yml #2199
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-10.15, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, windows-2019] | |
os: [macos-11, ubuntu-20.04, windows-2019] | |
steps: | |
- uses: actions/checkout@v2 | |
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-11 && windows] | |
shell: bash | |
if: matrix.os == 'macos-11' || 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-11] | |
if: matrix.os == 'macos-11' | |
run: | | |
echo $GITHUB_WORKSPACE | |
echo "OPENSSL_ROOT_DIR=/usr/local/opt/[email protected]" >> $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-11] | |
if: matrix.os == 'macos-11' | |
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-11] | |
if: matrix.os == 'macos-11' | |
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-11 && 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-11] | |
shell: bash | |
if: matrix.os == 'macos-11' | |
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-11] | |
shell: bash | |
if: matrix.os == 'macos-11' | |
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@v2 | |
if: matrix.os == 'windows-2019' || matrix.os == 'macos-11' | |
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@v2 | |
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@v2 | |
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 |