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
This commit is contained in:
Pascal Hartig
2021-02-12 04:33:48 -08:00
committed by Facebook GitHub Bot
parent 061ca274fd
commit 7fd0c7d82e
2 changed files with 10 additions and 2 deletions

View File

@@ -5,6 +5,11 @@ on:
tags:
- v*
workflow_dispatch:
inputs:
tag:
description: "Tag to upload artifacts to"
required: false
jobs:
build:
@@ -37,9 +42,11 @@ jobs:
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
- 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'

View File

@@ -202,3 +202,4 @@ jobs:
workflow: Publish Android
token: ${{ secrets.PERSONAL_TOKEN }}
ref: ${{ needs.release.outputs.tag }}
inputs: '{"tag": "${{ needs.release.outputs.tag }}"}'