Build #249
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build a Phoenix apk for Testnet, using the master branch. | |
name: Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ master, test-ci-build ] | |
paths: | |
- 'phoenix-android/**' | |
- '.github/workflows/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# 1 - checkout project and dependencies | |
- name: Checkout Phoenix | |
uses: actions/checkout@v2 | |
with: | |
path: phoenix | |
- name: Checkout lightning-kmp | |
uses: actions/checkout@v2 | |
with: | |
repository: ACINQ/lightning-kmp | |
ref: master | |
path: lightning-kmp | |
# 2 - setup cache/jdk | |
- name: Cached Konan | |
uses: actions/cache@v4 | |
with: | |
path: ~/.konan | |
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
restore-keys: ${{ runner.os }}-konan- | |
- name: Set up jdk 1.17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
# 3 - build dependencies & app | |
- name: Build lightning-kmp and install to local maven repo | |
run: | | |
cd lightning-kmp | |
./gradlew clean build publishToMavenLocal -x check | |
- name: Assemble the android apk | |
run: | | |
cd phoenix | |
./gradlew clean | |
printf "\nskip.android=false" >> local.properties | |
./gradlew :phoenix-android:assembleRelease --stacktrace | |
# 4 - sign apk | |
- name: Retrieve signing key | |
run: 'echo "$TESTNET_KEY_HEX" | xxd -r -p > signingkey' | |
shell: bash | |
env: | |
TESTNET_KEY_HEX: ${{secrets.TESTNET_KEY_HEX}} | |
- name: Sign artifact | |
run: | | |
mkdir upload | |
mv phoenix/phoenix-android/build/outputs/apk/release/phoenix-*.apk upload/phoenix-testnet-latest.apk | |
/usr/local/lib/android/sdk/build-tools/34.0.0/apksigner sign --ks signingkey --ks-pass pass:$TESTNET_STORE_PASS --ks-key-alias $TESTNET_ALIAS --key-pass pass:$TESTNET_KEY_PASS upload/phoenix-testnet-latest.apk | |
shell: bash | |
env: | |
TESTNET_STORE_PASS: ${{secrets.TESTNET_STORE_PASS}} | |
TESTNET_ALIAS: ${{secrets.TESTNET_ALIAS}} | |
TESTNET_KEY_PASS: ${{secrets.TESTNET_KEY_PASS}} | |
# 5 - upload apk | |
- name: Upload apk as artifact for this action | |
uses: actions/upload-artifact@v4 | |
with: | |
name: phoenix-testnet | |
path: upload/phoenix-testnet-latest.apk | |
- name: Upload to acinq.co | |
run: | | |
aws s3 cp ./upload/phoenix-testnet-latest.apk s3://acinq.co/pub/phoenix/ | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: 'eu-west-1' |