Files
breez-sdk-liquid/.github/workflows/publish-android.yml
Erdem Yerebasmaz 573a345801 Downgrade android release to Uniffi 0.25 (#786)
* fix: revert minSdkVersion across all uniffi packages

This PR fixes a regression introduced in https://github.com/breez/breez-sdk-liquid/pull/766 due to a confusion between minSdkVersion requirement & minimum compileSdkVersion requirement.

* Bump package requirements on flutter_breez_liquid README

* Bump JNA used on bindings tests to 5.14.0

* Downgrade android release to Uniffi 0.25

---------

Co-authored-by: Ross Savage <hello@satimoto.com>
2025-03-19 13:41:44 +03:00

91 lines
3.7 KiB
YAML

name: Publish Android Bindings
on:
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
package-version:
description: 'version for the gradle library (MAJOR.MINOR.BUILD)'
required: true
type: string
publish:
description: 'value indicating whether to publish to maven.'
required: true
type: boolean
default: false
secrets:
BREEZ_MVN_USERNAME:
description: 'username for gradlew publish'
required: true
BREEZ_MVN_PASSWORD:
description: 'password for gradlew publish'
required: true
jobs:
build-package:
runs-on: ubuntu-latest
steps:
- name: Checkout breez-sdk-liquid repo
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref || github.sha }}
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- uses: actions/download-artifact@v4
with:
name: bindings-android-jniLibs-uniffi-25
path: lib/bindings/langs/android/lib/src/main/jniLibs
- uses: actions/download-artifact@v4
with:
name: bindings-kotlin
path: lib/bindings/langs/android/lib/src/main/kotlin
- name: Build Android project
working-directory: lib/bindings/langs/android
env:
ORG_GRADLE_PROJECT_libraryVersion: ${{ inputs.package-version || '0.0.1' }}
run: ./gradlew assemble
- name: Archive aar
uses: actions/upload-artifact@v4
with:
name: android-release.aar
path: lib/bindings/langs/android/lib/build/outputs/aar/lib-release.aar
- name: Publish artifacts
if: ${{ inputs.publish }}
working-directory: lib/bindings/langs/android
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BREEZ_MVN_USERNAME: ${{ secrets.BREEZ_MVN_USERNAME }}
BREEZ_MVN_PASSWORD: ${{ secrets.BREEZ_MVN_PASSWORD }}
run: |
./gradlew publish -PlibraryVersion=${{ inputs.package-version }} -PbreezReposiliteUsername="$BREEZ_MVN_USERNAME" -PbreezReposilitePassword="$BREEZ_MVN_PASSWORD"
- name: Trigger Jitpack build
if: ${{ inputs.publish }}
shell: bash
run: |
# Jitpack only makes artifacts avaiable when someone requests them.
# Here we trick Jitpack into thinking we're already requesting the newly built package
# to make sure it is available right away for anyone that needs it later.
# We're waiting for at most 60s before triggering the Jitpack build to give our Maven repo
# some time to process the just uploaded files (the Jitpack build is dependent upon them being available).
# If anything fails here, we'll still finish sucessfully as this is an optional optimization.
timeout 60 bash -c 'while [[ "$(curl --output /dev/null --silent --head --write-out ''%{http_code}'' https://mvn.breez.technology/releases/breez_sdk_liquid/bindings-android/${{ inputs.package-version }}/bindings-android-${{ inputs.package-version }}.pom)" != "200" ]]; do echo "Waiting for package to be published on mvn.breez.technology..." && sleep 5; done && echo "Package found."' || echo "Package not found." && true
echo "Attempting to trigger Jitpack build..."
curl -s -m 30 https://jitpack.io/api/builds/com.github.breez/breez-sdk-liquid/${{ inputs.package-version }} || true
echo "Done"