Skip to content

Commit

Permalink
🔨 CI: don't upload APK to "latest" if not on main
Browse files Browse the repository at this point in the history
  • Loading branch information
berlix committed Feb 17, 2024
1 parent 23379bd commit 89bf54f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }}
S3_BASE_URL: s3://dl.eidu.com/
S3_HTTP_BASE_URL: https://dl.eidu.com/
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_UPLOAD_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_UPLOAD_SECRET_ACCESS_KEY }}
AWS_EC2_METADATA_DISABLED: true

steps:
# This step serves as a workaround for not being able to use ${{ env.* }} in global env vars.
Expand Down Expand Up @@ -47,14 +50,14 @@ jobs:
base64 -d <<< "${{ secrets.ANDROID_RELEASE_KEYSTORE_BASE64 }}" > integration-test-app/$ANDROID_KEYSTORE_PATH
./gradlew assembleRelease --stacktrace
- name: Upload App APK to S3
- name: Upload App APK to S3 (by run number)
run: |
aws s3 cp integration-test-app/build/outputs/apk/release/integration-test-app-release.apk "${{ env.S3_BASE_URL }}${{ env.S3_CI_OBJECT_PATH }}"
- name: Upload App APK to S3 (latest)
run: |
aws s3 cp integration-test-app/build/outputs/apk/release/integration-test-app-release.apk "${{ env.S3_BASE_URL }}${{ env.S3_LATEST_OBJECT_PATH }}"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_UPLOAD_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_UPLOAD_SECRET_ACCESS_KEY }}
AWS_EC2_METADATA_DISABLED: true
if: github.ref == 'refs/heads/main'

- uses: actions/checkout@v2
with:
Expand Down

0 comments on commit 89bf54f

Please sign in to comment.