mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2026-01-04 23:04:25 +01:00
134 lines
3.7 KiB
YAML
134 lines
3.7 KiB
YAML
name: Build bindings for iOS
|
|
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: macOS-latest
|
|
name: build ${{ matrix.target }}
|
|
strategy:
|
|
matrix:
|
|
target: [
|
|
aarch64-apple-ios,
|
|
x86_64-apple-ios,
|
|
aarch64-apple-ios-sim,
|
|
]
|
|
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 }}
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: lib
|
|
|
|
- name: Install xcode
|
|
uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: latest-stable
|
|
|
|
- name: Build bindings
|
|
working-directory: lib/bindings
|
|
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.a
|
|
|
|
merge:
|
|
runs-on: macOS-latest
|
|
needs: build
|
|
name: build ios-universal
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: bindings-aarch64-apple-ios
|
|
path: aarch64-apple-ios
|
|
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: bindings-x86_64-apple-ios
|
|
path: x86_64-apple-ios
|
|
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: bindings-aarch64-apple-ios-sim
|
|
path: aarch64-apple-ios-sim
|
|
|
|
- name: Build ios-universal
|
|
run: |
|
|
mkdir -p ios-universal
|
|
lipo -create -output ios-universal/libbreez_liquid_sdk_bindings.a aarch64-apple-ios/libbreez_liquid_sdk_bindings.a x86_64-apple-ios/libbreez_liquid_sdk_bindings.a
|
|
|
|
- name: Build ios-universal-sim
|
|
run: |
|
|
mkdir -p ios-universal-sim
|
|
lipo -create -output ios-universal-sim/libbreez_liquid_sdk_bindings.a aarch64-apple-ios-sim/libbreez_liquid_sdk_bindings.a x86_64-apple-ios/libbreez_liquid_sdk_bindings.a
|
|
|
|
- name: Archive ios-universal
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: bindings-ios-universal
|
|
path: ios-universal/libbreez_liquid_sdk_bindings.a
|
|
|
|
- name: Archive ios-universal-sim
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: bindings-ios-universal-sim
|
|
path: ios-universal-sim/libbreez_liquid_sdk_bindings.a
|
|
|
|
build-dummies:
|
|
if: ${{ inputs.use-dummy-binaries }}
|
|
runs-on: ubuntu-latest
|
|
name: build ios dummies
|
|
strategy:
|
|
matrix:
|
|
target: [
|
|
aarch64-apple-ios,
|
|
x86_64-apple-ios,
|
|
aarch64-apple-ios-sim,
|
|
ios-universal,
|
|
ios-universal-sim,
|
|
]
|
|
steps:
|
|
- name: Build dummy ios ${{ matrix.target }}
|
|
run: |
|
|
touch libbreez_liquid_sdk_bindings.a
|
|
|
|
- name: Upload dummy ios ${{ matrix.target }} artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: bindings-${{ matrix.target }}
|
|
path: ./*
|