Skip to content

Commit

Permalink
Testing out android ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
Miha Drofenik committed Dec 25, 2023
1 parent 136d914 commit afae7dc
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build and Deploy

on:
push:
branches:
- initial

jobs:
android-build:
name: Android Dev Build
runs-on: ubuntu-latest
container:
image: reactnativecommunity/react-native-android
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
- name: Checkout repo from dev branch
uses: actions/checkout@v3
with:
ref: initial
- name: Install npm dependency
run: npm install
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- 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/gradle-build-action@v2
- name: Execute Gradle build
run: |
cd android
./gradlew build
- name: Build Android JS Bundle
run: |
npm run package-android
- name: Delete Android build duplicate assets resource
run: npm 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
18 changes: 18 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@ platform :android do
build_type: "Debug"
)

firebase_app_distribution(
app: ENV["APP_ID"],
testers: ENV["TESTERS"],
release_notes: ENV["RELEASE_NOTES"],
android_artifact_path: ENV["ANDROID_ARTEFACT_PATH"],
service_credentials_file: ENV["SERVICE_CREDENTIALS_FILE"]
)
end

platform :android do
desc "Build a debug version of the app"
lane :build_release do
gradle(
project_dir: "./android",
task: "bundle",
build_type: "Debug"
)

firebase_app_distribution(
app: ENV["APP_ID"],
testers: ENV["TESTERS"],
Expand Down

0 comments on commit afae7dc

Please sign in to comment.