Skip to content

Compile CLI wallet binaries #7

Compile CLI wallet binaries

Compile CLI wallet binaries #7

name: Compile CLI wallet binaries
on:
workflow_dispatch:
inputs:
dusk_blockchain_ref:
description: "GIT branch, ref, or SHA to checkout"
required: true
default: "master"
defaults:
run:
shell: bash
jobs:
build_and_publish:
name: Build rusk-wallet binaries for ${{ matrix.os }} with ${{ matrix.compiler }}.
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-latest, macos-12, windows-latest]
compiler: [cargo]
include:
- os: ubuntu-20.04
compiler: cargo
target: linux-x64
- os: ubuntu-22.04
compiler: cargo
target: linux-x64-libssl3
- os: macos-latest
compiler: cargo
target: macos-intel
- os: macos-12
compiler: cargo
target: macos-arm64
flags: --target=aarch64-apple-darwin
platform: aarch64-apple-darwin
- os: windows-latest
compiler: cargo
target: windows-x64
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.dusk_blockchain_ref }}
- name: Install dependencies
uses: dsherret/rust-toolchain-file@v1
- name: Add arm target for Apple Silicon build
run: rustup target add aarch64-apple-darwin
if: ${{ matrix.os == 'macos-12' }}
- name: Build Wallet
shell: bash
working-directory: ./rusk-wallet
run: ${{matrix.compiler}} b --release --verbose ${{matrix.flags}}
- name: Get semver from wallet binary
run: |
ls -la target/release
export SEMVER=$(cargo pkgid --mainfest-path ./rusk-wallet/Cargo.toml | perl -lpe 's/.*\@(.*)/$1/')
echo "SEMVER=$SEMVER" >> $GITHUB_ENV
- name: "Pack binaries"
run: |
mkdir rusk-wallet${{env.SEMVER}}-${{matrix.target}}
echo "Fetching changelog and readme files..."
mv target/${{matrix.platform}}/release/rusk-wallet rusk-wallet${{env.SEMVER}}-${{matrix.target}}
cp ./rusk-wallet/CHANGELOG.md rusk-wallet${{env.SEMVER}}-${{matrix.target}}
cp ./rusk-wallet/README.md rusk-wallet${{env.SEMVER}}-${{matrix.target}}
tar -czvf ruskwallet${{env.SEMVER}}-${{matrix.target}}.tar.gz rusk-wallet${{env.SEMVER}}-${{matrix.target}}
ls -la *.gz
- name: "Upload Wallet Artifacts"
uses: actions/upload-artifact@v3
with:
name: wallet-binaries-${{env.SEMVER}}
path: |
./*.gz
retention-days: 5