From 1ab655a1bfd479bec1ec60a3836d79d307ccef99 Mon Sep 17 00:00:00 2001 From: Yamil Medina Date: Thu, 27 Jun 2024 12:18:42 +0200 Subject: [PATCH] ci: s3 path for artifacts adjustment (WPB-8730) (#3131) --- .github/actions/deploy-to-s3/action.yml | 27 ++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/actions/deploy-to-s3/action.yml b/.github/actions/deploy-to-s3/action.yml index 2a38c4ec861..633da6fd119 100644 --- a/.github/actions/deploy-to-s3/action.yml +++ b/.github/actions/deploy-to-s3/action.yml @@ -22,20 +22,37 @@ inputs: runs: using: "composite" steps: - - name: Copy build to tmp file + - name: Set APK full path + id: path shell: bash - run: - cp app/build/outputs/apk/${{ inputs.build-flavour }}/${{ inputs.build-variant }}/com.wire.*.apk wire-android-${{ inputs.build-flavour }}-${{ inputs.build-variant }}-pr-${{ github.event.pull_request.number }}.apk - - name: Upload to S3 + run: | + APK_FULL_PATH_REF="$(set -- app/build/outputs/apk/${{ inputs.build-flavour }}/${{ inputs.build-variant }}/com.wire.*.apk; echo $1)" + echo "apk_full_path=$APK_FULL_PATH_REF" >> $GITHUB_OUTPUT + unset APK_FULL_PATH_REF + - name: Upload to S3 from PR + if: github.event.pull_request.number != '' id: upload uses: hkusu/s3-upload-action@v2.1.0 + with: + aws-access-key-id: ${{ inputs.aws-access-key-id }} + aws-secret-access-key: ${{ inputs.aws-secret-access-key }} + aws-region: 'us-west-1' + aws-bucket: ${{ inputs.aws-bucket }} + destination-dir: "megazord/android/reloaded/${{ inputs.build-flavour }}/${{ inputs.build-variant }}/PR-${{ github.event.pull_request.number }}/" + file-path: ${{ steps.path.outputs.apk_full_path }} + output-file-url: 'true' + public: true + - name: Upload to S3 from branch + if: github.event.pull_request.number == '' + id: upload-from-branch + uses: hkusu/s3-upload-action@v2.1.0 with: aws-access-key-id: ${{ inputs.aws-access-key-id }} aws-secret-access-key: ${{ inputs.aws-secret-access-key }} aws-region: 'us-west-1' aws-bucket: ${{ inputs.aws-bucket }} destination-dir: "megazord/android/reloaded/${{ inputs.build-flavour }}/${{ inputs.build-variant }}/" - file-path: './wire-android-${{ inputs.build-flavour }}-${{ inputs.build-variant }}-pr-${{ github.event.pull_request.number }}.apk' + file-path: ${{ steps.path.outputs.apk_full_path }} output-file-url: 'true' public: true - name: Show URL