Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: GitHub actions upload to s3 testing the theory #3023

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions .github/workflows/testing-test-build-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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 }})"
52 changes: 42 additions & 10 deletions .github/workflows/upload-aws-s3.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: "Upload builds"

permissions:
contents: read

on:
workflow_call:
inputs:
Expand All @@ -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/[email protected]
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
Expand Down
Loading