Summary: From the changelog: > Removed the deprecated uploadArchives and installArchives tasks. Use publish and publishToMavenLocal instead. Made the necessary changes to docs and scripts. Reviewed By: nikoant Differential Revision: D29752895 fbshipit-source-id: 6e96c7ea9b26be2acb40b9089cb361837ab10a1b
59 lines
2.1 KiB
YAML
59 lines
2.1 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: Install NDK 20, 21
|
|
run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.0.6113669" "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}
|
|
- 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'
|