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

[NO QA] Correct paths for upload android hybrid adhoc #53530

Merged
Merged
Changes from 1 commit
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
60 changes: 11 additions & 49 deletions .github/workflows/testBuildHybrid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
run:
working-directory: Mobile-Expensify/react-native
outputs:
APK_FILE_NAME: ${{ steps.build.outputs.APK_FILE_NAME }}
S3_APK_PATH: ${{ steps.exportAndroidS3Path.outputs.S3_APK_PATH }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -139,9 +139,6 @@ jobs:
bundler-cache: true
working-directory: 'Mobile-Expensify/react-native'

- name: Install New Expensify Gems
run: bundle install

- name: Install 1Password CLI
uses: 1password/install-cli-action@v1

Expand Down Expand Up @@ -175,68 +172,33 @@ jobs:
ANDROID_UPLOAD_KEYSTORE_PASSWORD: ${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_PASSWORD }}
ANDROID_UPLOAD_KEYSTORE_ALIAS: ${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_ALIAS }}
ANDROID_UPLOAD_KEY_PASSWORD: ${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEY_PASSWORD }}
run: |
bundle exec fastlane android build_adhoc_hybrid

# Refresh environment variables from GITHUB_ENV that are updated when running fastlane
# shellcheck disable=SC1090
source "$GITHUB_ENV"

# apkPath is set within the Fastfile
echo "APK_FILE_NAME=$(basename "$apkPath")" >> "$GITHUB_OUTPUT"


uploadAndroid:
name: Upload Android hybrid app to S3
needs: [androidHybrid]
runs-on: ubuntu-latest
outputs:
S3_APK_PATH: ${{ steps.exportS3Path.outputs.S3_APK_PATH }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1.190.0
with:
bundler-cache: true

- name: Download Android build artifacts
uses: actions/download-artifact@v4
with:
path: /tmp/artifacts
pattern: android-*-artifact
merge-multiple: true

- name: Log downloaded artifact paths
run: ls -R /tmp/artifacts

run: bundle exec fastlane android build_adhoc_hybrid

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Upload AdHoc build to S3
- name: Upload Android AdHoc build to S3
run: bundle exec fastlane android upload_s3
env:
apkPath: /tmp/artifacts/${{ needs.androidHybrid.outputs.APK_FILE_NAME }}
S3_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY_ID }}
S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_BUCKET: ad-hoc-expensify-cash
S3_REGION: us-east-1
S3_REGION: us-east-1

- name: Export S3 paths
id: exportS3Path
- name: Export S3 path
id: exportAndroidS3Path
run: |
# $s3APKPath is set from within the Fastfile, android upload_s3 lane
echo "S3_APK_PATH=$s3APKPath" >> "$GITHUB_OUTPUT"

postGithubComment:
runs-on: ubuntu-latest
name: Post a GitHub comment with app download links for testing
needs: [validateActor, getBranchRef, uploadAndroid] #TODO add ios job
needs: [validateActor, getBranchRef, androidHybrid] #TODO add ios job
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the // todo, we'll track this on the main issue. COuld you remove please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 🫡

if: ${{ always() }}
steps:
- name: Checkout
Expand All @@ -255,5 +217,5 @@ jobs:
with:
PR_NUMBER: ${{ env.PULL_REQUEST_NUMBER }}
GITHUB_TOKEN: ${{ github.token }}
ANDROID: ${{ needs.uploadAndroid.result }}
ANDROID_LINK: ${{ needs.uploadAndroid.outputs.S3_APK_PATH }}
ANDROID: ${{ needs.androidHybrid.result }}
ANDROID_LINK: ${{ needs.androidHybrid.outputs.S3_APK_PATH }}
Loading