Files
flipper/.github/workflows/publish-android.yml
Pascal Hartig 5be3b4b0f0 Upgrade GitHub workflow java version (#4750)
Summary:
[android] Upgrade GitHub workflow java version
Version 8 of AGP requires Java 17+. Let's upgrade it here.

There are some flags that are no longer supported, hence the update to gradle.properties.

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

Test Plan:
- CI

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/flipper/pull/4750).
* https://github.com/facebook/flipper/issues/4755
* https://github.com/facebook/flipper/issues/4754
* https://github.com/facebook/flipper/issues/4753
* https://github.com/facebook/flipper/issues/4752
* https://github.com/facebook/flipper/issues/4751
* __->__ https://github.com/facebook/flipper/issues/4750
* https://github.com/facebook/flipper/issues/4749

Reviewed By: antonk52

Differential Revision: D46067505

Pulled By: passy

fbshipit-source-id: b673535ac9bd08a35bdb61b9a9ec0a38c957ceef
2023-05-22 06:19:41 -07:00

65 lines
2.2 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@v2
- name: set up JDK
uses: actions/setup-java@v1
with:
java-version: 17
- 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 }}\nSONATYPE_HOST=DEFAULT\nRELEASE_SIGNING_ENABLED=true\nSONATYPE_AUTOMATIC_RELEASE=true" >> 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 -info
- 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: aigoncharov/github-upload-release-artifacts-action@2.2.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
created_tag: ${{ github.event.inputs.tag }}
args: 'SampleApp-android.apk'
- name: Open issue on failure
if: failure()
uses: JasonEtco/create-an-issue@v2.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY: ${{ github.repository }}
RUN_ID: ${{ github.run_id }}
WORKFLOW_NAME: "Publish Android"
with:
filename: .github/action-failure-template.md