Set up release automation (#1915)
Summary: Depends on https://github.com/facebook/flipper/issues/1914. This sets up the workflows for automatically building, publishing and "closing" the repository on Maven Central, which is a step you usually need to do manually in the web UI. Still need to transfer all the secrets over to this repo for it to work. Pull Request resolved: https://github.com/facebook/flipper/pull/1915 Test Plan: Ran all of this in my this in my fork and released some `0.0.x` versions. - Successful workflow: https://github.com/passy/flipper-1/actions/runs/552170713 - It's actually all on Maven: https://repo.maven.apache.org/maven2/com/facebook/flipper/ Reviewed By: jknoxville Differential Revision: D26367469 Pulled By: passy fbshipit-source-id: d65f64ee8eec1dc71af64b7e0f87473b9c956fec
This commit is contained in:
committed by
Facebook GitHub Bot
parent
87d7bcf274
commit
0085a0d140
29
.github/workflows/android.yml
vendored
29
.github/workflows/android.yml
vendored
@@ -1,29 +0,0 @@
|
||||
name: Publish Android Sample App On Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
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 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: Build with Gradle
|
||||
run: ./gradlew :sample:assembleDebug :sample:assembleRelease
|
||||
- name: Rename apk
|
||||
run: mv android/sample/build/outputs/apk/debug/sample-debug.apk SampleApp-android.apk
|
||||
- name: Upload
|
||||
uses: skx/github-action-publish-binaries@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
args: 'SampleApp-android.apk'
|
||||
45
.github/workflows/publish-android.yml
vendored
Normal file
45
.github/workflows/publish-android.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Publish Android
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
workflow_dispatch:
|
||||
|
||||
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: Upload Sample App
|
||||
uses: skx/github-action-publish-binaries@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
args: 'SampleApp-android.apk'
|
||||
7
.github/workflows/release.yml
vendored
7
.github/workflows/release.yml
vendored
@@ -195,3 +195,10 @@ jobs:
|
||||
workflow: Publish NPM
|
||||
token: ${{ secrets.PERSONAL_TOKEN }}
|
||||
ref: ${{ needs.release.outputs.tag }}
|
||||
- name: Publish Android
|
||||
if: ${{ needs.release.outputs.tag != '' }}
|
||||
uses: benc-uk/workflow-dispatch@v1.1
|
||||
with:
|
||||
workflow: Publish Android
|
||||
token: ${{ secrets.PERSONAL_TOKEN }}
|
||||
ref: ${{ needs.release.outputs.tag }}
|
||||
|
||||
Reference in New Issue
Block a user