Files
flipper/.github/workflows/publish-android.yml
Pascal Hartig 7fd0c7d82e Fix upload of sample app apk (#1920)
Summary:
This was an expected failure, you can see here how the last step of the "Publish Android" workflow currently fails: https://github.com/facebook/flipper/runs/1873750507?check_suite_focus=true

This is because it no longer runs in a tagging context. We're now providing the tag as an input and my custom action knows how to attach to existing tags by name.

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

Test Plan:
Test run here finished successfully: https://github.com/passy/flipper-1/actions/runs/560774414
Publish Android job: https://github.com/passy/flipper-1/actions/runs/560775419
Attached release: https://github.com/passy/flipper-1/releases/tag/v0.0.7
Artifacts on Central: https://repo.maven.apache.org/maven2/com/facebook/flipper/flipper/0.0.7/

{F372552533}

{F372552532}

Reviewed By: mweststrate

Differential Revision: D26402629

Pulled By: passy

fbshipit-source-id: 7290e6bb8d1078ee20a0cf10105dc37f1e7aa99a
2021-02-12 04:36:11 -08:00

53 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: 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 }}" >> gradle.properties
- name: Build artifacts
run: ./gradlew :sample:assembleDebug :sample:assembleRelease && ./gradlew :android:assembleRelease
- name: Upload Archives
run: ./gradlew uploadArchives --no-parallel --no-daemon
env:
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
- name: Release and close
run: ./gradlew closeAndReleaseRepository
env:
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
- 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'