mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2025-12-29 11:54:26 +01:00
97 lines
2.8 KiB
YAML
97 lines
2.8 KiB
YAML
name: Build bindings for Linux
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
ref:
|
|
description: 'commit/tag/branch reference'
|
|
required: true
|
|
type: string
|
|
workflow_call:
|
|
inputs:
|
|
repository:
|
|
description: 'sdk repository, defaults to current repository'
|
|
required: false
|
|
type: string
|
|
ref:
|
|
description: 'commit/tag/branch reference'
|
|
required: true
|
|
type: string
|
|
use-dummy-binaries:
|
|
description: 'If true, creates dummy binaries rather than real binaries'
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
|
|
jobs:
|
|
build:
|
|
if: ${{ !inputs.use-dummy-binaries }}
|
|
runs-on: ubuntu-20.04
|
|
name: build ${{ matrix.target }}
|
|
strategy:
|
|
matrix:
|
|
target: [
|
|
aarch64-unknown-linux-gnu,
|
|
x86_64-unknown-linux-gnu,
|
|
]
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
ref: ${{ inputs.ref }}
|
|
repository: ${{ inputs.repository || github.repository }}
|
|
|
|
- name: Install rust toolchain
|
|
run: |
|
|
rustup set auto-self-update disable
|
|
rustup toolchain install stable --profile minimal
|
|
rustup target add ${{ matrix.target }}
|
|
|
|
- name: Install gcc-aarch64-linux-gnu
|
|
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
|
|
|
- name: Install gcc-x86-64-linux-gnu
|
|
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y gcc-x86-64-linux-gnu g++-x86-64-linux-gnu
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: lib
|
|
|
|
- name: Build bindings
|
|
working-directory: lib/bindings
|
|
env:
|
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/aarch64-linux-gnu-gcc
|
|
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/x86_64-linux-gnu-gcc
|
|
run: cargo build --release --target ${{ matrix.target }}
|
|
|
|
- name: Archive release
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: bindings-${{ matrix.target }}
|
|
path: lib/target/${{ matrix.target }}/release/libbreez_liquid_sdk_bindings.so
|
|
|
|
build-dummies:
|
|
if: ${{ inputs.use-dummy-binaries }}
|
|
runs-on: ubuntu-latest
|
|
name: build linux dummies
|
|
strategy:
|
|
matrix:
|
|
target: [
|
|
aarch64-unknown-linux-gnu,
|
|
x86_64-unknown-linux-gnu,
|
|
]
|
|
steps:
|
|
- name: Build dummy linux ${{ matrix.target }}
|
|
run: |
|
|
touch libbreez_liquid_sdk_bindings.so
|
|
|
|
- name: Upload dummy linux ${{ matrix.target }} artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: bindings-${{ matrix.target }}
|
|
path: ./* |