Skip to content

Commit

Permalink
Merge branch 'main' into fix/52666
Browse files Browse the repository at this point in the history
  • Loading branch information
nkdengineer committed Dec 12, 2024
2 parents 7c12b42 + 082e14b commit 5331afd
Show file tree
Hide file tree
Showing 222 changed files with 4,405 additions and 3,556 deletions.
444 changes: 354 additions & 90 deletions .github/actions/javascript/authorChecklist/index.js

Large diffs are not rendered by default.

36 changes: 20 additions & 16 deletions .github/workflows/createNewVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ jobs:
runs-on: macos-latest
needs: [validateActor, createNewVersion]
if: ${{ fromJSON(needs.validateActor.outputs.HAS_WRITE_ACCESS) }}
defaults:
run:
working-directory: Mobile-Expensify
steps:
- name: Run turnstyle
uses: softprops/turnstyle@49108bdfa571e62371bd2c3094893c547ab3fc03
Expand All @@ -121,22 +118,17 @@ jobs:
uses: actions/checkout@v4
with:
ref: main
submodules: true
# The OS_BOTIFY_COMMIT_TOKEN is a personal access token tied to osbotify
# This is a workaround to allow pushes to a protected branch
token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}

- name: Check out `Mobile-Expensify` repo
uses: actions/checkout@v4
with:
repository: 'Expensify/Mobile-Expensify'
submodules: true
path: 'Mobile-Expensify'
token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}

- name: Update submodule
- name: Update submodule and checkout the main branch
run: |
cd react-native
git submodule update --init
cd Mobile-Expensify
git checkout main
git pull origin main
- name: Setup git for OSBotify
uses: ./.github/actions/composite/setupGitForOSBotify
Expand All @@ -146,6 +138,7 @@ jobs:

- name: Generate HybridApp version
run: |
cd Mobile-Expensify
# Generate all flavors of the version
SHORT_APP_VERSION=$(echo "$NEW_VERSION" | awk -F'-' '{print $1}')
BUILD_NUMBER=$(echo "$NEW_VERSION" | awk -F'-' '{print $2}')
Expand All @@ -156,6 +149,7 @@ jobs:
ANDROID_MANIFEST_FILE="Android/AndroidManifest.xml"
IOS_INFO_PLIST_FILE="iOS/Expensify/Expensify-Info.plist"
IOS_SHARE_EXTENSION_PLIST_FILE="iOS/SmartScanExtension/Info.plist"
IOS_NOTIFICATION_EXTENSION_PLIST_FILE="iOS/NotificationServiceExtension/Info.plist"
JS_CONFIG_FILE="app/config/config.json"
# Update Android HybridApp Version
Expand All @@ -167,6 +161,8 @@ jobs:
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $FULL_APP_VERSION" $IOS_INFO_PLIST_FILE
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $SHORT_APP_VERSION" $IOS_SHARE_EXTENSION_PLIST_FILE
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $FULL_APP_VERSION" $IOS_SHARE_EXTENSION_PLIST_FILE
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $SHORT_APP_VERSION" $IOS_NOTIFICATION_EXTENSION_PLIST_FILE
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $FULL_APP_VERSION" $IOS_NOTIFICATION_EXTENSION_PLIST_FILE
# Update JS HybridApp Version
sed -i .bak -E "s/\"version\": \"([0-9\.]*)\"/\"version\": \"$FULL_APP_VERSION\"/" $JS_CONFIG_FILE
Expand All @@ -175,15 +171,23 @@ jobs:

- name: Commit new version
run: |
cd Mobile-Expensify
git add \
./Android/AndroidManifest.xml \
./app/config/config.json \
./iOS/Expensify/Expensify-Info.plist\
./iOS/SmartScanExtension/Info.plist
./iOS/SmartScanExtension/Info.plist \
./iOS/NotificationServiceExtension/Info.plist
git commit -m "Update version to ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
- name: Update main branch
run: git push origin main
- name: Update main branch on Mobile-Expensify and App
run: |
cd Mobile-Expensify
git push origin main
cd ..
git add Mobile-Expensify
git commit -m "Update Mobile-Expensify to ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
git push origin main
- name: Announce failed workflow in Slack
if: ${{ failure() }}
Expand Down
71 changes: 17 additions & 54 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,46 +163,25 @@ jobs:
name: Build and deploy Android HybridApp
needs: prep
runs-on: ubuntu-latest-xl
defaults:
run:
working-directory: Mobile-Expensify/react-native
steps:
- name: Checkout App repo
uses: actions/checkout@v4

- name: Checkout Mobile-Expensify repo
- name: Checkout App and Mobile-Expensify repo
uses: actions/checkout@v4
with:
repository: 'Expensify/Mobile-Expensify'
submodules: true
path: 'Mobile-Expensify'
token: ${{ secrets.OS_BOTIFY_TOKEN }}
# fetch-depth: 0 is required in order to fetch the correct submodule branch
fetch-depth: 0

- name: Update submodule
- name: Update submodule to match main
run: |
git submodule update --init
# Update submodule to latest on staging
git fetch
git checkout staging
git submodule update --init --remote
- name: Configure MapBox SDK
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}

- uses: actions/setup-node@v4
with:
node-version-file: 'Mobile-Expensify/react-native/.nvmrc'
cache: npm
cache-dependency-path: 'Mobile-Expensify/react-native'

- name: Install node modules
run: |
npm install
cd .. && npm install
# Fixes https://github.com/Expensify/App/issues/51682
npm run grunt:build:shared
- name: Setup Node
id: setup-node
uses: ./.github/actions/composite/setupNode

- name: Setup Java
uses: actions/setup-java@v4
Expand All @@ -214,7 +193,6 @@ jobs:
uses: ruby/[email protected]
with:
bundler-cache: true
working-directory: 'Mobile-Expensify/react-native'

- name: Install New Expensify Gems
run: bundle install
Expand All @@ -229,7 +207,7 @@ jobs:
op document get --output ./upload-key.keystore upload-key.keystore
op document get --output ./android-fastlane-json-key.json android-fastlane-json-key.json
# Copy the keystore to the Android directory for Fullstory
cp ./upload-key.keystore ../Android
cp ./upload-key.keystore Mobile-Expensify/Android
- name: Load Android upload keystore credentials from 1Password
id: load-credentials
Expand All @@ -244,7 +222,7 @@ jobs:

- name: Get Android native version
id: getAndroidVersion
run: echo "VERSION_CODE=$(grep -oP 'android:versionCode="\K[0-9]+' ../Android/AndroidManifest.xml)" >> "$GITHUB_OUTPUT"
run: echo "VERSION_CODE=$(grep -oP 'android:versionCode="\K[0-9]+' Mobile-Expensify/Android/AndroidManifest.xml)" >> "$GITHUB_OUTPUT"

- name: Build Android app
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
Expand All @@ -261,10 +239,11 @@ jobs:
VERSION: ${{ steps.getAndroidVersion.outputs.VERSION_CODE }}

- name: Get current Android rollout percentage
if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
id: getAndroidRolloutPercentage
uses: ./.github/actions/javascript/getAndroidRolloutPercentage
with:
GOOGLE_KEY_FILE: Mobile-Expensify/react-native/android-fastlane-json-key.json
GOOGLE_KEY_FILE: ./android-fastlane-json-key.json
PACKAGE_NAME: org.me.mobiexpensifyg

- name: Submit production build for Google Play review and a slow rollout
Expand Down Expand Up @@ -496,47 +475,31 @@ jobs:
runs-on: macos-13-xlarge
env:
DEVELOPER_DIR: /Applications/Xcode_15.2.0.app/Contents/Developer
defaults:
run:
working-directory: Mobile-Expensify/react-native
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'Expensify/Mobile-Expensify'
submodules: true
path: 'Mobile-Expensify'
token: ${{ secrets.OS_BOTIFY_TOKEN }}
# fetch-depth: 0 is required in order to fetch the correct submodule branch
fetch-depth: 0

- name: Update submodule
run: |
git submodule update --init
# Update submodule to latest on staging
git fetch
git checkout staging
git submodule update --init --remote
- name: Configure MapBox SDK
run: |
./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}
- uses: actions/setup-node@v4
- name: Setup Node
id: setup-node
with:
node-version-file: 'Mobile-Expensify/react-native/.nvmrc'
cache-dependency-path: 'Mobile-Expensify/react-native'

- name: Install node modules
run: |
npm install
cd .. && npm install
uses: ./.github/actions/composite/setupNode

- name: Setup Ruby
uses: ruby/[email protected]
with:
bundler-cache: true
working-directory: 'Mobile-Expensify/react-native'

- name: Install New Expensify Gems
run: bundle install
Expand All @@ -545,20 +508,20 @@ jobs:
uses: actions/cache@v4
id: pods-cache
with:
path: ios/Pods
key: ${{ runner.os }}-pods-cache-${{ hashFiles('ios/Podfile.lock', 'firebase.json') }}
path: Mobile-Expensify/ios/Pods
key: ${{ runner.os }}-pods-cache-${{ hashFiles('Mobile-Expensify/ios/Podfile.lock', 'firebase.json') }}

- name: Compare Podfile.lock and Manifest.lock
id: compare-podfile-and-manifest
run: echo "IS_PODFILE_SAME_AS_MANIFEST=${{ hashFiles('ios/Podfile.lock') == hashFiles('ios/Pods/Manifest.lock') }}" >> "$GITHUB_OUTPUT"
run: echo "IS_PODFILE_SAME_AS_MANIFEST=${{ hashFiles('Mobile-Expensify/ios/Podfile.lock') == hashFiles('Mobile-Expensify/ios/Pods/Manifest.lock') }}" >> "$GITHUB_OUTPUT"

- name: Install cocoapods
uses: nick-fields/retry@3f757583fb1b1f940bc8ef4bf4734c8dc02a5847
if: steps.pods-cache.outputs.cache-hit != 'true' || steps.compare-podfile-and-manifest.outputs.IS_PODFILE_SAME_AS_MANIFEST != 'true' || steps.setup-node.outputs.cache-hit != 'true'
with:
timeout_minutes: 10
max_attempts: 5
command: cd Mobile-Expensify/iOS && pod install
command: npm run pod-install

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

0 comments on commit 5331afd

Please sign in to comment.