Skip to content

Build App and Upload #57

Build App and Upload

Build App and Upload #57

Workflow file for this run

name: "Build App and Upload"
on:
# manual trigger but change to any supported event
# see addl: https://www.andrewhoog.com/post/how-to-build-react-native-android-app-with-github-actions/#3-run-build-workflow
workflow_dispatch:
inputs:
buildPlatform:
description: 'Platform to Build'
required: true
default: 'all'
type: choice
options:
- all
- ios
- android
release:
types: [published]
jobs:
build_ios:
runs-on: macos-13
# build for ios if platform is ios or all, or if triggered by a release
if: github.event_name == 'release' || inputs.buildPlatform == 'all' || inputs.buildPlatform == 'ios'
steps:
- name: List Xcode Installs
run: sudo ls -1 /Applications | grep "Xcode"
- name: Select Xcode 15.2
run: sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
- name: Check Xcode Version
run: /usr/bin/xcodebuild -version
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Fastlane and Fix CocoaPods
run: |
sudo gem install cocoapods -v 1.15.2
sudo gem install fastlane -NV
fastlane --version
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Cache NPM Dependencies
uses: actions/cache@v2
id: cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
- name: Install Dependencies
run: npm install
- name: Expo Prebuild [iOS]
run: |
npx expo prebuild --platform ios --npm
- name: Fastlane Build [iOS]
run: fastlane ios build
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
ASC_KEY_BASE64: ${{ secrets.ASC_KEY_BASE64 }}
GIT_AUTHORIZATION: ${{ secrets.GIT_AUTHORIZATION }}
CHANGELOG: ${{ github.event.release.body }}
build_android:
runs-on: ubuntu-latest
# build for android if platform is android or all, or if triggered by a release
if: github.event_name == 'release' || inputs.buildPlatform == 'all' || inputs.buildPlatform == 'android'
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Fastlane
run: |
sudo gem install fastlane -NV
fastlane --version
- name: Install JDK 22
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '22'
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Cache NPM Dependencies
uses: actions/cache@v2
id: cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
- name: Install Dependencies
run: npm install
- name: Expo Prebuild [Android]
run: |
npx expo prebuild --platform android --npm
- name: Fastlane Build [Android]
run: fastlane android build
env:
GOOGLE_PLAY_KEY: ${{ secrets.GOOGLE_PLAY_KEY }}
PACKAGE_NAME: "com.maroonrides.maroonrides"