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] Separate build and upload Fastlane lanes #48754

Merged
merged 21 commits into from
Sep 9, 2024
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
41598db
Separate build and upload lanes for Android
roryabraham Sep 6, 2024
52f45d3
Update deploy.yml android deploy job
roryabraham Sep 6, 2024
1c1937b
Update testBuild.yml Android fastlane steps
roryabraham Sep 6, 2024
aa4bb19
Move -rostruct to workflow level
roryabraham Sep 6, 2024
152758a
Move RUBYOPT to Android job level
roryabraham Sep 6, 2024
433c222
DRY up code to setup iOS signing certificate
roryabraham Sep 7, 2024
6bbfcda
Separate build and upload lanes for ios
roryabraham Sep 7, 2024
c120b75
Update ios fastlane usage in deploy.yml
roryabraham Sep 7, 2024
3826d71
Update ios fastlane usage in testBuild.yml
roryabraham Sep 7, 2024
3aab0df
Move PULL_REQUEST_NUMBER environment variable to workflow level
roryabraham Sep 7, 2024
a4d3daa
Put gradle apk output path in env
roryabraham Sep 7, 2024
51874d5
Communicate across lanes with environment variables
roryabraham Sep 7, 2024
0026ff1
Rename step from Run Fastlane
roryabraham Sep 7, 2024
5a7fee7
Include platform in android s3 upload
roryabraham Sep 7, 2024
54cc2fe
Add logs in setOutputsInEnv utilities
roryabraham Sep 7, 2024
124a8ae
Add logs when reading custom env vars
roryabraham Sep 7, 2024
7a56429
Move description to the right place
roryabraham Sep 7, 2024
4731625
Create and use setEnvVarsInParentShell utility function
roryabraham Sep 7, 2024
dc653fe
Rename to simply exportEnvVars
roryabraham Sep 7, 2024
d3a130d
Improve comment
roryabraham Sep 7, 2024
3f02959
Merge branch 'main' into Rory-SeparateBuildAndDeploy
roryabraham Sep 9, 2024
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
26 changes: 21 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -71,6 +71,8 @@ jobs:
name: Build and deploy Android
needs: prep
runs-on: ubuntu-latest-xl
env:
RUBYOPT: '-rostruct'
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -106,12 +108,16 @@ jobs:
id: getAndroidVersion
run: echo "VERSION_CODE=$(grep -o 'versionCode\s\+[0-9]\+' android/app/build.gradle | awk '{ print $2 }')" >> "$GITHUB_OUTPUTS"

- name: Run Fastlane
run: bundle exec fastlane android ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'beta' }}
- name: Build Android app
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: bundle exec fastlane android build
env:
RUBYOPT: '-rostruct'
MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }}
MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }}

- name: Upload Android app to Google Play
run: bundle exec fastlane android ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'upload_google_play_production' || 'upload_google_play_internal' }}
env:
VERSION: ${{ steps.getAndroidVersion.outputs.VERSION_CODE }}

- name: Upload Android build to Browser Stack
@@ -269,13 +275,23 @@ jobs:
id: getIOSVersion
run: echo "IOS_VERSION=$(echo '${{ needs.prep.outputs.APP_VERSION }}' | tr '-' '.')" >> "$GITHUB_OUTPUTS"

- name: Run Fastlane
run: bundle exec fastlane ios ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'beta' }}
- name: Build iOS release app
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: bundle exec fastlane ios build

- name: Upload release build to TestFlight
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: bundle exec fastlane ios upload_testflight
env:
APPLE_CONTACT_EMAIL: ${{ secrets.APPLE_CONTACT_EMAIL }}
APPLE_CONTACT_PHONE: ${{ secrets.APPLE_CONTACT_PHONE }}
APPLE_DEMO_EMAIL: ${{ secrets.APPLE_DEMO_EMAIL }}
APPLE_DEMO_PASSWORD: ${{ secrets.APPLE_DEMO_PASSWORD }}

- name: Submit build for App Store review
if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: bundle exec fastlane ios submit_for_review
env:
VERSION: ${{ steps.getIOSVersion.outputs.IOS_VERSION }}

- name: Upload iOS build to Browser Stack
34 changes: 17 additions & 17 deletions .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
@@ -10,6 +10,9 @@ on:
types: [opened, synchronize, labeled]
branches: ['*ci-test/**']

env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}

jobs:
validateActor:
runs-on: ubuntu-latest
@@ -35,7 +38,6 @@ jobs:
echo "The 'Ready to Build' label is not attached to the PR #${{ env.PULL_REQUEST_NUMBER }}"
fi
env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
GITHUB_TOKEN: ${{ github.token }}

getBranchRef:
@@ -64,7 +66,7 @@ jobs:
if: ${{ fromJSON(needs.validateActor.outputs.READY_TO_BUILD) }}
runs-on: ubuntu-latest-xl
env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
RUBYOPT: '-rostruct'
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -111,17 +113,19 @@ jobs:
- name: Configure MapBox SDK
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}

- name: Run Fastlane beta test
id: runFastlaneBetaTest
run: bundle exec fastlane android build_internal
- name: Run AdHoc build
run: bundle exec fastlane android build_adhoc
env:
MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }}
MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }}

- name: Upload AdHoc build to S3
run: bundle exec fastlane android upload_s3
env:
RUBYOPT: '-rostruct'
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
MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }}
MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }}

- name: Upload Artifact
uses: actions/upload-artifact@v4
@@ -134,7 +138,6 @@ jobs:
needs: [validateActor, getBranchRef]
if: ${{ fromJSON(needs.validateActor.outputs.READY_TO_BUILD) }}
env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
DEVELOPER_DIR: /Applications/Xcode_15.2.0.app/Contents/Developer
runs-on: macos-13-xlarge
steps:
@@ -205,8 +208,11 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Run Fastlane
run: bundle exec fastlane ios build_internal
- name: Build AdHoc app
run: bundle exec fastlane ios build_adhoc

- name: Upload AdHoc build to S3
run: bundle exec fastlane ios upload_s3
env:
S3_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY_ID }}
S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -223,8 +229,6 @@ jobs:
name: Build and deploy Desktop for testing
needs: [validateActor, getBranchRef]
if: ${{ fromJSON(needs.validateActor.outputs.READY_TO_BUILD) }}
env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
runs-on: macos-14-large
steps:
- name: Checkout
@@ -268,8 +272,6 @@ jobs:
name: Build and deploy Web
needs: [validateActor, getBranchRef]
if: ${{ fromJSON(needs.validateActor.outputs.READY_TO_BUILD) }}
env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
runs-on: ubuntu-latest-xl
steps:
- name: Checkout
@@ -304,8 +306,6 @@ jobs:
name: Post a GitHub comment with app download links for testing
needs: [validateActor, getBranchRef, android, iOS, desktop, web]
if: ${{ always() }}
env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
steps:
- name: Checkout
uses: actions/checkout@v4
Loading