Skip to content

Commit

Permalink
feat: upload android apks to build artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
bonomat committed Feb 1, 2024
1 parent d53a447 commit 4e32a2a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/android-fastlane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,24 @@ jobs:
ORACLE_PUBKEY: ${{ inputs.oracle_pubkey }}
RGS_SERVER_URL: ${{ inputs.rgs_server_url }}

- name: Build Android APK
id: build-android
run: |
NETWORK=$NETWORK just build-android-app-apk
env:
ESPLORA_ENDPOINT: ${{ inputs.esplora_endpoint }}
COORDINATOR_P2P_ENDPOINT: ${{ inputs.coordinator_p2p_endpoint }}
NETWORK: ${{ inputs.network }}
COORDINATOR_PORT_HTTP: ${{ inputs.coordinator_port_http }}
ORACLE_ENDPOINT: ${{ inputs.oracle_endpoint }}
ORACLE_PUBKEY: ${{ inputs.oracle_pubkey }}
RGS_SERVER_URL: ${{ inputs.rgs_server_url }}

- uses: actions/upload-artifact@v4
with:
name: apks
path: build/app/outputs/flutter-apk/

- name: Release to Google Play Store
env:
# secrets
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Feat(webapp): Show order history
- Fix: Add reject dlc channel, settle and renew offer
- Chore: Change pending offer policy to reject on reconnect
- Feat: upload APKs as artifact to GitHub

## [1.8.4] - 2024-01-31

Expand Down
33 changes: 33 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,39 @@ build-android-app-bundle:
--dart-define="RGS_SERVER_URL=${RGS_SERVER_URL}" \
"${flavor_arg[@]}"

build-android-app-apk:
#!/usr/bin/env bash
BUILD_NAME=$(yq -r .version {{pubspec}})
BUILD_NUMBER=$(git rev-list HEAD --count)
echo "build name: ${BUILD_NAME}"
echo "build number: ${BUILD_NUMBER}"
flavor_arg=()
if [ "$NETWORK" = "regtest" ]; then
flavor_arg+=(--flavor demo)
else
flavor_arg+=(--flavor full)
fi

# Replacing package id using the env variable.
os={{os()}}
echo "building on '$os' for '$NETWORK'"

cd mobile && flutter build apk --split-per-abi \
--build-name=${BUILD_NAME} \
--build-number=${BUILD_NUMBER} \
--release \
--dart-define="ESPLORA_ENDPOINT=${ESPLORA_ENDPOINT}" \
--dart-define="COORDINATOR_P2P_ENDPOINT=${COORDINATOR_P2P_ENDPOINT}" \
--dart-define="NETWORK=${NETWORK}" \
--dart-define="COMMIT=$(git rev-parse HEAD)" \
--dart-define="BRANCH=$(git rev-parse --abbrev-ref HEAD)" \
--dart-define="COORDINATOR_PORT_HTTP=${COORDINATOR_PORT_HTTP}" \
--dart-define="ORACLE_ENDPOINT=${ORACLE_ENDPOINT}" \
--dart-define="ORACLE_PUBKEY=${ORACLE_PUBKEY}" \
--dart-define="RGS_SERVER_URL=${RGS_SERVER_URL}" \
"${flavor_arg[@]}"

upload-app-bundle:
#!/usr/bin/env bash
Expand Down

0 comments on commit 4e32a2a

Please sign in to comment.