From 7fd0c7d82e35fea4bf61595b0db19bc313eaacc8 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 12 Feb 2021 04:33:48 -0800 Subject: [PATCH] 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 --- .github/workflows/publish-android.yml | 11 +++++++++-- .github/workflows/release.yml | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index 5dcfba43b..5f3346784 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -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' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b031d319..5ea4409c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -202,3 +202,4 @@ jobs: workflow: Publish Android token: ${{ secrets.PERSONAL_TOKEN }} ref: ${{ needs.release.outputs.tag }} + inputs: '{"tag": "${{ needs.release.outputs.tag }}"}'