Skip to content

Merge pull request #4 from LayerTwo-Labs/dependabot/github_actions/ac… #40

Merge pull request #4 from LayerTwo-Labs/dependabot/github_actions/ac…

Merge pull request #4 from LayerTwo-Labs/dependabot/github_actions/ac… #40

Workflow file for this run

name: Build
on:
pull_request:
push:
branches:
- "master"
- "sidechain"
workflow_dispatch:
jobs:
build-linux:
name: Build Linux binaries
runs-on: ubuntu-latest-large
steps:
# https://zcash.readthedocs.io/en/master/rtd_pages/Debian-Ubuntu-build.html
- name: install Linux deps
run: sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python3 python3-zmq zlib1g-dev curl bsdmainutils automake libtinfo5
- uses: actions/checkout@v4
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ./depends
key: ${{ runner.os }}-${{ hashFiles('depends/packages/**') }}
- name: download dependencies
run: make -C ./depends download-linux
- name: build dependencies
run: make -C ./depends -j
- run: ./autogen.sh
- run: echo "HOST=$(./depends/config.guess)" >> $GITHUB_ENV
- run: echo "CONFIG_SITE=$PWD/depends/$HOST/share/config.site" >> $GITHUB_ENV
- run: ./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
- run: make -C src cargo-build-lib
- run: echo BRIDGE_LOCATION=$(dirname $(./contrib/devtools/find-libcxxbridge.sh)) >> $GITHUB_ENV
- run: echo LDFLAGS="-L$BRIDGE_LOCATION -lcxxbridge1" >> $GITHUB_ENV
# Reconfigure the build, taking our freshly compiled Rust C++ bridge into account.
- run: ./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
- run: make -j
- uses: actions/upload-artifact@v4
with:
name: binaries-${{ runner.os }}
if-no-files-found: error
path: |
src/zsided
src/zside-cli
build-windows:
name: Build Windows binaries
runs-on: ubuntu-latest
steps:
# https://zcash.readthedocs.io/en/master/rtd_pages/Debian-Ubuntu-build.html
- uses: actions/checkout@v4
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ./depends
key: Windows-${{ hashFiles('depends/packages/**') }}
- name: Run build in Docker
uses: addnab/docker-run-action@v3
with:
image: electriccoinco/zcashd-build-ubuntu-jammy
options: -v ${{ github.workspace }}:/zside --workdir=/zside
shell: bash
run: |
set -e
make -C ./depends download-win
HOST=x86_64-w64-mingw32 make -C ./depends
export CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site
./autogen.sh
./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
make -C src cargo-build-lib
BRIDGE_LOCATION=$(dirname $(./contrib/devtools/find-libcxxbridge.sh))
export LDFLAGS="-L$BRIDGE_LOCATION -lcxxbridge1"
./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
make -j
- uses: actions/upload-artifact@v4
with:
name: binaries-Windows
if-no-files-found: error
path: |
src/zsided.exe
src/zside-cli.exe
build-macos:
name: Build macOS binaries
runs-on: macos-latest-large
steps:
# https://zcash.readthedocs.io/en/master/rtd_pages/Debian-Ubuntu-build.html
- name: install deps
run: brew install pkgconfig automake autoconf libtool coreutils
- uses: actions/checkout@v4
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ./depends
key: ${{ runner.os }}-${{ hashFiles('depends/packages/**') }}
- name: Set HOST + BUILD
run: |
echo BUILD=x86_64-apple-darwin23.0.0 >> $GITHUB_ENV
echo HOST=x86_64-apple-darwin23.0.0 >> $GITHUB_ENV
- name: download dependencies
run: make -C ./depends download-osx
- name: build dependencies
run: make -C ./depends -j
- run: ./autogen.sh
- run: echo "CONFIG_SITE=$PWD/depends/$HOST/share/config.site" >> $GITHUB_ENV
- run: ./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
- run: make -C src cargo-build-lib
- run: find ./target -name libcxxbridge1.a
- run: echo BRIDGE_LOCATION=$(dirname $(./contrib/devtools/find-libcxxbridge.sh)) >> $GITHUB_ENV
- run: echo LDFLAGS="-L$BRIDGE_LOCATION -lcxxbridge1" >> $GITHUB_ENV
# Reconfigure the build, taking our freshly compiled Rust C++ bridge into account.
- run: ./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
- run: make -j
- uses: actions/upload-artifact@v4
with:
name: binaries-${{ runner.os }}
if-no-files-found: error
path: |
src/zsided
src/zside-cli
upload-artifacts-to-releases-drivechain-info:
name: Upload artifacts to releases.drivechain.info
runs-on: ubuntu-latest
needs: [build-linux, build-macos]
# avoid uploading on PRs!
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'LayerTwo-Labs'
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Zip artifacts
run: |
mv binaries-Linux L2-S5-ZSide-latest-x86_64-unknown-linux-gnu
zip -r L2-S5-ZSide-latest-x86_64-unknown-linux-gnu.zip L2-S5-ZSide-latest-x86_64-unknown-linux-gnu
mv binaries-macOS L2-S5-ZSide-latest-x86_64-apple-darwin
zip -r L2-S5-ZSide-latest-x86_64-apple-darwin.zip L2-S5-ZSide-latest-x86_64-apple-darwin
- name: Upload artifacts to releases.drivechain.info
uses: cross-the-world/ssh-scp-ssh-pipelines@latest
with:
host: 45.33.96.47
user: root
pass: ${{ secrets.RELEASES_SERVER_PW }}
port: 22
scp: |
'L2-S5-*.zip' => '/var/www/html/'