Files
flipper/.github/workflows/publish-android.yml
Pascal Hartig da9511a5bf Fix CI build for Android (#2836)
Summary:
I've been really sweating about this one. It looks like Google now removed NDK 21 as it's too old. However, we've been struggling with the upgrade because OpenSSL was built against an old version of the NDK/glibc/LLVM/some other stuff.

I've now managed to create an OpenSSL distribution for 1.1.1k (we had 1.1.0h before) that seems to build with this after some small modifications.

This seems to do the trick, but I wouldn't be shocked if we found some more incompatibilities further down the line.

Pull Request resolved: https://github.com/facebook/flipper/pull/2836

Test Plan:
- Locally: `./gradlew :tutorial:installDebug`. Builds, starts up. Cool.
- Public GitHub CI: Happy.
- Circle CI: Only triggers post-land. We'll see. But the setup is simple, so hopefully it should work there, too.
- Internal CI: Waiting for signal.

Reviewed By: fabiomassimo

Differential Revision: D30839209

Pulled By: passy

fbshipit-source-id: efe599f28cc0edfdf2149f905c3483555239edc0
2021-09-09 08:46:59 -07:00

57 lines
1.9 KiB
YAML

name: Publish Android
on:
push:
tags:
- v*
workflow_dispatch:
inputs:
tag:
description: "Tag to upload artifacts to"
required: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Write GPG Sec Ring
run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg
- name: Update gradle.properties
run: echo -e "signing.secretKeyRingFile=/tmp/secring.gpg\nsigning.keyId=${{ secrets.SIGNING_KEY_ID }}\nsigning.password=${{ secrets.SIGNING_PASSWORD }}\nmavenCentralPassword=${{ secrets.SONATYPE_NEXUS_PASSWORD }}\nmavenCentralUsername=${{ secrets.SONATYPE_NEXUS_USERNAME }}" >> gradle.properties
- name: Compute build cache
run: ./scripts/checksum-android.sh checksum-android.txt
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum-android.txt') }}
- name: Build artifacts
run: ./gradlew :sample:assembleDebug :sample:assembleRelease && ./gradlew :android:assembleRelease
- name: Upload Archives
run: ./gradlew publish --no-parallel --no-daemon
- name: Release and close
run: ./gradlew closeAndReleaseRepository
- name: Clean secrets
if: always()
run: rm /tmp/secring.gpg
- name: Rename apk
run: mv android/sample/build/outputs/apk/debug/sample-debug.apk SampleApp-android.apk
- name: Attach sample APK to release
if: ${{ github.event.inputs.tag != '' }}
uses: passy/github-upload-release-artifacts-action@v2.1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
created_tag: ${{ github.event.inputs.tag }}
args: 'SampleApp-android.apk'