Skip to content

.env example update #40

.env example update

.env example update #40

Workflow file for this run

name: App Dev Builds
on:
push:
branches: ["nt/gh-actions"]
jobs:
ios-build:
name: iOS Dev Build
runs-on: macos-latest
environment: Android Dev
steps:
- name: Show host machine infomation
run: uname -a
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
- name: Checkout repo from dev branch
uses: actions/checkout@v3
with:
ref: nt/gh-actions
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0.0"
- name: Setup Cocoapods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.15.2
- name: Create Google Services PLIST File
env:
GOOGLE_JSON: ${{ secrets.GOOGLE_PLIST }}
run: echo $GOOGLE_PLIST | base64 --decode > ./ios/GoogleService-Info.plist
# - name: Cache cocoapods
# uses: actions/cache@v3
# with:
# path: /ios/Pods
# key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
# restore-keys: |
# ${{ runner.os }}-pods-
- name: Install npm dependency
run: yarn install
- name: Build iOS JS Bundle
run: |
yarn run package-ios
- name: Install bundler
run: |
cd ios
gem install bundler
- name: Install gem plugins
run: |
cd ios
bundle install
- name: Run fastlane
run: |
cd ios
bundle exec fastlane build_testflight
android-build:
name: Android Dev Build
runs-on: macos-latest
environment: Android Dev
steps:
- name: Show host machine infomation
run: uname -a
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
- name: Checkout repo from dev branch
uses: actions/checkout@v3
with:
ref: nt/gh-actions
- name: Create .env file
run: |
echo "ACTIVITY_WEBSOCKET_URL=${{ vars.ACTIVITY_WEBSOCKET_URL }}" >> .env
echo "BUGSNAG_API_KEY=${{ secrets.BUGSNAG_API_KEY }}" >> .env
echo "DEFAULT_PIN=${{ secrets.DEFAULT_PIN }}" >> .env
echo "ECENCY_BACKEND_API=${{ vars.ECENCY_BACKEND_API }}" >> .env
echo "NEW_IMAGE_API=${{ vars.NEW_IMAGE_API }}" >> .env
echo "PIN_KEY=${{ secrets.PIN_KEY }}" >> .env
echo "SERVER_LIST_API=${{ vars.SERVER_LIST_API }}" >> .env
echo "USER_AGENT=${{ vars.USER_AGENT }}" >> .env
echo "PLAUSIBLE_API_KEY=${{ secrets.PLAUSIBLE_API_KEY }}" >> .env
- name: Install npm dependency
run: yarn install
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
cmdline-tools-version: 11479570
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Create Google Services JSON File
env:
GOOGLE_JSON: ${{ secrets.GOOGLE_JSON }}
run: echo $GOOGLE_JSON | base64 --decode > ./android/app/google-services.json
- name: Bundle Android
run: yarn run bundle:android
- name: Execute Gradle build
run: |
cd android
./gradlew assembleDebug
# - name: Execute Gradle build
# run: |
# cd android
# ./gradlew assembleRelease
- name: Cache generated APK
uses: actions/cache@v3
with:
path: app/build/outputs/apk/
key: apk-${{ runner.os }}-${{ github.sha }}
restore-keys: |
apk-${{ runner.os }}-
- name: Upload application
uses: actions/upload-artifact@v4
with:
name: app
path: ./android/app/build/outputs/apk/debug/app-debug.apk
# - name: Build Android JS Bundle
# run: |
# yarn run package-android
# - name: Delete Android build duplicate assets resource
# run: yarn run delete-pics
# - name: Install bundler
# run: |
# cd android
# gem install bundler
# - name: Install gem plugins
# run: |
# cd android
# bundle install
# - name: Run fastlane
# run: |
# cd android
# bundle exec fastlane build_qa