Skip to content
Merged
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
39 changes: 7 additions & 32 deletions .github/workflows/react-native-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ jobs:
if: (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')) || github.event_name == 'workflow_dispatch'
strategy:
matrix:
platform: [android]
include:
- platform: ios
runs-on: macos-latest
platform: [android, ios]
runs-on: ${{ matrix.platform == 'ios' && 'macos-latest' || 'ubuntu-latest' }}
environment: RNBuild
steps:
Expand All @@ -124,28 +121,6 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-

- name: 🏗 Install Fastlane
run: |
yarn global add fastlane

- name: 🏗 Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
bundler-cache: true

- name: 🏗 Install bundler & Fastlane
run: |
gem install bundler:2.2.27
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3

- name: 📋 Run Fastlane Match
run: |
bundle exec fastlane ios certificates
env:
KEYCHAIN_PATH: ~/Library/Keychains/signing_temp.keychain-db

- name: 📦 Install dependencies
run: |
yarn install --frozen-lockfile
Expand Down Expand Up @@ -177,7 +152,7 @@ jobs:
eas --version

- name: 📱 Build Development APK
if: github.event.inputs.buildType == 'all' || github.event.inputs.buildType == 'dev' || github.event_name == 'push' && (matrix.platform == 'android' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'android')
if: (matrix.platform == 'android' && (github.event.inputs.buildType == 'all' || github.event_name == 'push' || github.event.inputs.buildType == 'dev'))
run: |
# Build with increased memory limit
export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
Expand All @@ -186,39 +161,39 @@ jobs:
NODE_ENV: development

- name: 📱 Build Production APK
if: github.event.inputs.buildType == 'all' || github.event.inputs.buildType == 'prod-apk' || github.event_name == 'push' && (matrix.platform == 'android' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'android')
if: (matrix.platform == 'android' && (github.event.inputs.buildType == 'all' || github.event_name == 'push' || github.event.inputs.buildType == 'prod-apk'))
run: |
export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
eas build --platform android --profile production-apk --local --non-interactive --output=./app-prod.apk
env:
NODE_ENV: production

- name: 📱 Build Production AAB
if: github.event.inputs.buildType == 'all' || github.event.inputs.buildType == 'prod-aab' || github.event_name == 'push' && (matrix.platform == 'android' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'android')
if: (matrix.platform == 'android' && (github.event.inputs.buildType == 'all' || github.event_name == 'push' || github.event.inputs.buildType == 'prod-aab'))
run: |
export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
eas build --platform android --profile production --local --non-interactive --output=./app-prod.aab
env:
NODE_ENV: production

- name: 📱 Build iOS Development
if: (github.event.inputs.buildType == 'all' || github.event_name == 'push' || github.event.inputs.buildType == 'ios-dev') && (matrix.platform == 'ios' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'ios')
if: (matrix.platform == 'ios' && (github.event.inputs.buildType == 'all' || github.event_name == 'push' || github.event.inputs.buildType == 'ios-dev'))
run: |
export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
eas build --platform ios --profile development --local --non-interactive --output=./app-ios-dev.app
env:
NODE_ENV: development

- name: 📱 Build iOS Ad-Hoc
if: (github.event.inputs.buildType == 'all' || github.event_name == 'push' || github.event.inputs.buildType == 'ios-adhoc') && (matrix.platform == 'ios' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'ios')
if: (matrix.platform == 'ios' && (github.event.inputs.buildType == 'all' || github.event_name == 'push' || github.event.inputs.buildType == 'ios-adhoc'))
run: |
export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
eas build --platform ios --profile internal --local --non-interactive --output=./app-ios-adhoc.app
env:
NODE_ENV: production

- name: 📱 Build iOS Production
if: (github.event.inputs.buildType == 'all' || github.event_name == 'push' || github.event.inputs.buildType == 'ios-prod') && (matrix.platform == 'ios' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'ios')
if: (matrix.platform == 'ios' && (github.event.inputs.buildType == 'all' || github.event_name == 'push' || github.event.inputs.buildType == 'ios-prod'))
run: |
export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
eas build --platform ios --profile production --local --non-interactive --output=./app-ios-prod.ipa
Expand Down
14 changes: 13 additions & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ default_platform :ios
platform :ios do
lane :certificates do
setup_ci

app_store_connect_api_key(
key_id: ENV["APP_STORE_CONNECT_KEY_ID"],
issuer_id: ENV["APP_STORE_CONNECT_ISSUER_ID"],
Expand All @@ -22,4 +22,16 @@ platform :ios do
match(git_url: ENV["MATCH_GIT_URL"], git_basic_authorization: ENV["MATCH_GIT_BASIC_AUTHORIZATION"], type: "adhoc", app_identifier: ENV["MATCH_UNIT_BUNDLEID"], readonly: true)
match(git_url: ENV["MATCH_GIT_URL"], git_basic_authorization: ENV["MATCH_GIT_BASIC_AUTHORIZATION"], type: "appstore", app_identifier: ENV["MATCH_UNIT_BUNDLEID"], readonly: true)
end

lane :prep_development do
sh("cp", ENV["sigh_com.resgrid.unit_development_profile-path"], "./profile.mobileprovision", "-f")
end

lane :prep_adhoc do
sh("cp", ENV["sigh_com.resgrid.unit_adhoc_profile-path"], "./profile.mobileprovision", "-f")
end

lane :prep_appstore do
sh("cp", ENV["sigh_com.resgrid.unit_appstore_profile-path"], "./profile.mobileprovision", "-f")
end
end
Loading