diff --git a/.github/workflows/testing-test-build-app.yml b/.github/workflows/testing-test-build-app.yml index 8c06126a834..19f4edfd8ec 100644 --- a/.github/workflows/testing-test-build-app.yml +++ b/.github/workflows/testing-test-build-app.yml @@ -27,12 +27,28 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | ./gradlew assembleStagingCompat -p ./ --no-daemon - uplod-to-s3: - runs-on: buildjet-8vcpu-ubuntu-2204 - needs: [testing-build-app] - steps: - - name: Upload APK staging compat - uses: ./.github/workflows/upload-aws-s3.yml + cp app/build/outputs/apk/staging/compat/com.wire.*.apk wire-android-staging-pr-${{ github.event.pull_request.number }}.apk + + - name: Checking ... + run: | + echo "AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}" + + - name: Uploading to S3 + id: upload + uses: hkusu/s3-upload-action@v2.1.0 with: - flavour: "staging" - buildType: "compat" + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: 'us-west-1' + aws-bucket: ${{ secrets.AWS_S3_BUCKET }} + destination-dir: "megazord/android/reloaded/staging/compat/" + file-path: './wire-android-staging-pr-${{ github.event.pull_request.number }}.apk' + output-file-url: 'true' + + - name: Show URL + env: + EVENT_FILE_PATH: artifacts/Event File/event.json + GITHUB_USER: ${{ github.actor }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr comment "${{ github.event.pull_request.number }}" --body "APKs built during build-by-boris are available [here](${{ steps.upload.outputs.file-url }})" diff --git a/.github/workflows/upload-aws-s3.yml b/.github/workflows/upload-aws-s3.yml index 366586b6d74..88aa95ed2b0 100644 --- a/.github/workflows/upload-aws-s3.yml +++ b/.github/workflows/upload-aws-s3.yml @@ -1,8 +1,5 @@ name: "Upload builds" -permissions: - contents: read - on: workflow_call: inputs: @@ -12,25 +9,60 @@ on: buildType: required: true type: string + secrets: + aws-access-key-id: + required: true + aws-secret-access-key: + required: true + aws-bucket: + required: true + +permissions: + contents: read jobs: deploy-to-s3: - runs-on: ubuntu-latest + runs-on: buildjet-8vcpu-ubuntu-2204 + env: + GITHUB_USER: ${{ github.actor }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout uses: actions/checkout@v4 with: submodules: recursive # Needed in order to fetch Kalium sources for building fetch-depth: 0 + + - name: Checking 4 + run: | + ls -la ./ + + - name: Checking 3 + run: | + ls -la ./app + + - name: Checking 2 + run: | + ls -la ./app/build/outputs/apk + + - name: Checking 1 + run: | + ls -la ./app/build/outputs/apk/${{inputs.flavour}} + + - name: Checking 0 + run: | + ls -la ./app/build/outputs/apk/${{inputs.flavour}}/${{inputs.buildType}}/ + - name: Uploading - uses: hkusu/s3-upload-action@v2 + id: upload + uses: hkusu/s3-upload-action@v2.1.0 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-access-key-id: ${{ secrets.aws-access-key-id }} + aws-secret-access-key: ${{ secrets.aws-secret-access-key }} aws-region: 'us-west-1' - aws-bucket: ${{ secrets.AWS_S3_BUCKET }} - destination-dir: "megazord/android/reloaded/${inputs.flavour}/${inputs.buildType}/" - file-path: './app/build/outputs/apk/${inputs.flavour}/${inputs.buildType}/com.wire.*.apk' + aws-bucket: ${{ secrets.aws-bucket }} + destination-dir: "megazord/android/reloaded/${{inputs.flavour}}/${{inputs.buildType}}/" + file-path: './app/build/outputs/apk/${{inputs.flavour}}/${{inputs.buildType}}/com.wire.*.apk' output-file-url: 'true' - name: Show URL