Skip to content

Commit

Permalink
Always deploy non-mock and mock version
Browse files Browse the repository at this point in the history
  • Loading branch information
gcomte committed Feb 14, 2024
1 parent b03473d commit b071330
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 29 deletions.
57 changes: 28 additions & 29 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ concurrency:
on:
push:
tags:
- 'v*.*.*'
- 'v*.*-test'

env:
GITHUB_REF: ${{ github.ref }}
Expand All @@ -20,21 +20,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Determine full version or mocked version
run: |
if [[ "${{ github.ref }}" =~ ^v*.*.*.-mock$ ]]; then
echo "CARGO_FEATURES='--no-default-features --features mock-deps'" >> $GITHUB_ENV
else
echo "Invalid tag format"
exit 1
fi
shell: bash
cross-compile-ios:
name: cross-compile-ios
runs-on: macos-latest
strategy:
matrix:
target: [ x86_64-apple-ios, aarch64-apple-ios, aarch64-apple-ios-sim ]
mock-deps: [ false, true ]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -60,25 +52,26 @@ jobs:
with:
use-cross: false
command: build
args: ${{ env.CARGO_FEATURES}} --release --target ${{ matrix.target }}
args: ${{ matrix.mock-deps ? '--no-default-features --features mock-deps' || '' }} --release --target ${{ matrix.target }}
- name: Upload library binaries
uses: actions/upload-artifact@v4
with:
path: target/${{ matrix.target }}/release/libuniffi_lipalightninglib.a
name: build-${{ matrix.target }}
name: build-${{ matrix.target }}${{ matrix.mock-deps ? '-mock' }}
- name: Upload bindings files
uses: actions/upload-artifact@v4
if: ${{ matrix.target == 'x86_64-apple-ios' }}
with:
path: bindings/swift/lipalightninglib*
name: bindings-files-ios
name: bindings-files-ios${{ matrix.mock-deps ? '-mock' }}

cross-compile-android:
name: cross-compile-android
runs-on: ubuntu-latest
strategy:
matrix:
target: [ aarch64-linux-android, armv7-linux-androideabi, i686-linux-android ]
mock-deps: [ false, true ]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -106,39 +99,42 @@ jobs:
with:
use-cross: true
command: build
args: ${{ env.CARGO_FEATURES}} --release --target ${{ matrix.target }}
args: ${{ matrix.mock-deps ? '--no-default-features --features mock-deps' || '' }} --release --target ${{ matrix.target }}
- name: Upload library binaries
uses: actions/upload-artifact@v4
with:
path: target/${{ matrix.target }}/release/libuniffi_lipalightninglib.so
name: build-${{ matrix.target }}
name: build-${{ matrix.target }}${{ matrix.mock-deps ? '-mock' }}
- name: Upload bindings file
uses: actions/upload-artifact@v4
if: ${{ matrix.target == 'aarch64-linux-android' }}
with:
path: bindings/kotlin/uniffi/lipalightninglib/lipalightninglib.kt
name: bindings-file-android
name: bindings-file-android${{ matrix.mock-deps ? '-mock' }}

lipo-ios:
name: lipo-ios
needs: [ cross-compile-ios, cross-compile-android ]
runs-on: macos-latest
strategy:
matrix:
mock-deps: [ false, true ]
steps:
- name: Download x86 bin
uses: actions/download-artifact@v4
with:
path: target/x86_64-apple-ios/release
name: build-x86_64-apple-ios
name: build-x86_64-apple-ios${{ matrix.mock-deps ? '-mock' }}
- name: Download aarch64 bin
uses: actions/download-artifact@v4
with:
path: target/aarch64-apple-ios/release
name: build-aarch64-apple-ios
name: build-aarch64-apple-ios${{ matrix.mock-deps ? '-mock' }}
- name: Download aarch64sim bin
uses: actions/download-artifact@v4
with:
path: target/aarch64-apple-ios-sim/release
name: build-aarch64-apple-ios-sim
name: build-aarch64-apple-ios-sim${{ matrix.mock-deps ? '-mock' }}
- name: Package simulator binaries
run: |
mkdir -p target/universal/release
Expand All @@ -149,12 +145,15 @@ jobs:
uses: actions/upload-artifact@v4
with:
path: target/universal/release/libuniffi_lipalightninglib_simulator.a
name: build-ios-simulator-universal
name: build-ios-simulator-universal${{ matrix.mock-deps ? '-mock' }}

deploy-ios:
name: deploy-ios
needs: lipo-ios
runs-on: ubuntu-latest
strategy:
matrix:
mock-deps: [ false, true ]
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -181,17 +180,17 @@ jobs:
uses: actions/download-artifact@v4
with:
path: target/aarch64-apple-ios/release
name: build-aarch64-apple-ios
name: build-aarch64-apple-ios${{ matrix.mock-deps ? '-mock' }}
- name: Download simulator universal bin
uses: actions/download-artifact@v4
with:
path: target/universal/release
name: build-ios-simulator-universal
name: build-ios-simulator-universal${{ matrix.mock-deps ? '-mock' }}
- name: Download bindings files
uses: actions/download-artifact@v4
with:
path: bindings/swift/
name: bindings-files-ios
name: bindings-files-ios${{ matrix.mock-deps ? '-mock' }}
- name: Create xcframework
run: |
git clone git@github.com:getlipa/lipa-lightning-lib-swift.git
Expand Down Expand Up @@ -224,7 +223,7 @@ jobs:
git add Package.swift
git add Sources/LipaLightningLib/LipaLightningLib.swift
git commit -m "This commit was created automatically by the lipa bot"
git tag -a ${{ env.RELEASE_VERSION }} HEAD -m "This tag was created automatically by the lipa bot."
git tag -a ${{ env.RELEASE_VERSION }}${{ matrix.mock-deps ? '-mock' }} HEAD -m "This tag was created automatically by the lipa bot."
git push
git push --tag
- name: Create release
Expand Down Expand Up @@ -279,22 +278,22 @@ jobs:
uses: actions/download-artifact@v4
with:
path: target/aarch64-linux-android/release
name: build-aarch64-linux-android
name: build-aarch64-linux-android${{ matrix.mock-deps ? '-mock' }}
- name: Download armv7 bin
uses: actions/download-artifact@v4
with:
path: target/armv7-linux-androideabi/release
name: build-armv7-linux-androideabi
name: build-armv7-linux-androideabi${{ matrix.mock-deps ? '-mock' }}
- name: Download i686 bin
uses: actions/download-artifact@v4
with:
path: target/i686-linux-android/release
name: build-i686-linux-android
name: build-i686-linux-android${{ matrix.mock-deps ? '-mock' }}
- name: Download bindings file
uses: actions/download-artifact@v4
with:
path: bindings/kotlin/uniffi/lipalightninglib
name: bindings-file-android
name: bindings-file-android${{ matrix.mock-deps ? '-mock' }}
- name: Push to target repo
run: |
git clone git@github.com:getlipa/lipa-lightning-lib-android.git
Expand Down Expand Up @@ -327,7 +326,7 @@ jobs:
git add LipaLightningLib/src/main/java/com/getlipa/lipalightninglib/lipalightninglib.kt
git add jitpack.yml
git commit -m "This commit was created automatically by the lipa bot"
git tag -a ${{ env.RELEASE_VERSION }} HEAD -m "This tag was created automatically by the lipa bot."
git tag -a ${{ env.RELEASE_VERSION }}${{ matrix.mock-deps ? '-mock' }} HEAD -m "This tag was created automatically by the lipa bot."
git push
git push --tag
- name: Create release
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/templates/cross-compile-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: cross-compile-ios

config:
cargo-features:
required: false

cross-compile-ios:
name: cross-compile-ios
runs-on: macos-latest
strategy:
matrix:
target: [ x86_64-apple-ios, aarch64-apple-ios, aarch64-apple-ios-sim ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Config cargo
run: echo -e "$CARGO_CONFIG_TOML_BREEZ" > .cargo/config.toml
env:
CARGO_CONFIG_TOML_BREEZ: ${{ secrets.CARGO_CONFIG_TOML_BREEZ }}
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.72.0
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build target
uses: actions-rs/cargo@v1
with:
use-cross: false
command: build
args: ${{ config.cargo_features }} --release --target ${{ matrix.target }}
- name: Upload library binaries
uses: actions/upload-artifact@v4
with:
path: target/${{ matrix.target }}/release/libuniffi_lipalightninglib.a
name: build-${{ matrix.target }}
- name: Upload bindings files
uses: actions/upload-artifact@v4
if: ${{ matrix.target == 'x86_64-apple-ios' }}
with:
path: bindings/swift/lipalightninglib*
name: bindings-files-ios

0 comments on commit b071330

Please sign in to comment.