Skip to content

Commit

Permalink
Merge pull request #13 from frontegg/FR-12452-support-react-native
Browse files Browse the repository at this point in the history
FR-12452 - Support react native
  • Loading branch information
frontegg-david authored Jul 13, 2023
2 parents afad94a + bce50f0 commit dc331e8
Show file tree
Hide file tree
Showing 32 changed files with 365 additions and 624 deletions.
78 changes: 67 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
env:
CI: true
LANG: en_US.UTF-8
API_LEVEL: 29

concurrency:
group: ci-push-${{ github.ref }}
Expand All @@ -15,28 +16,83 @@ concurrency:
jobs:
build-and-test:
name: Build And Test
runs-on: ubuntu-latest
runs-on: macos-latest
steps:
- name: Checkout repo
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
# - name: Clone Mock Server
# uses: actions/checkout@v3
# with:
# repository: frontegg/frontegg-mock-server
# ssh-key: ${{ secrets.MOCK_SERVER_SSH_KEY }}
# ref: "master"
# path: mocker
# - name: Install Mock Server
# working-directory: mocker
# run: yarn install
# - name: Run Mock Server
# working-directory: mocker
# env:
# ANDROID_ASSOCIATED_DOMAIN_GRADLE_PATH: "${{ github.workspace }}/app/build.gradle"
# SERVER_HOSTNAME: "10.0.2.2"
# NGROCK_AUTH_TOKEN: "${{ secrets.NGROCK_AUTH_TOKEN }}"
# NGROCK_SUBDOMAIN: "frontegg-test"
# run: |
# echo "ANDROID_ASSOCIATED_DOMAIN_GRADLE_PATH: $ANDROID_ASSOCIATED_DOMAIN_GRADLE_PATH"
# echo "SERVER_HOSTNAME: $SERVER_HOSTNAME"
# echo "NGROCK_SUBDOMAIN: $NGROCK_SUBDOMAIN"
# (yarn start:mobile-mock&)
# sleep 40

- name: Set git config
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
- name: Setup JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
settings-path: ${{ github.workspace }} # location for the settings.xml file
server-id: ossrh
server-username: NEXUS_USERNAME
server-password: NEXUS_PASSWORD
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: GPG_PASSPHRASE
cache: 'gradle'
distribution: temurin

- name: Gradle cache
uses: gradle/gradle-build-action@v2

- name: Build Libraries
run: ./gradlew build --no-daemon
# - name: AVD cache
# uses: actions/cache@v3
# id: avd-cache
# with:
# path: |
# ~/.android/avd/*
# ~/.android/adb*
# key: avd-${{env.API_LEVEL}}
#
# - name: Create AVD and generate snapshot for caching
# if: steps.avd-cache.outputs.cache-hit != 'true'
# uses: reactivecircus/android-emulator-runner@v2
# with:
# avd-name: "AndroidEmulator"
# api-level: ${{env.API_LEVEL}}
# force-avd-creation: false
# emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
# disable-animations: true
# script: echo "Generated AVD snapshot for caching."

# - name: Run tests
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: ${{env.API_LEVEL}}
# force-avd-creation: false
# emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
# disable-animations: true
# script: ./run-tests.sh
#
# - name: Upload test results
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: test-results
# path: app/build/reports/androidTests/connected/
11 changes: 5 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,25 @@ on:
types: [ closed ]
branches:
- master
push:
branches:
- FR-12452-support-react-native

concurrency:
group: ci-release-${{ github.ref }}
cancel-in-progress: true

jobs:
publish-packages:
if: "github.event.pull_request.merged == true"
# if: "github.event.pull_request.merged == true"
name: "Publish Libraries"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
fetch-depth: "0"
- name: Checkout repo
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
fetch-depth: "0"
- name: Set git config
run: |
git config --global user.name 'github-actions'
Expand Down
14 changes: 6 additions & 8 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group 'com.frontegg.android'
version '1.0.2'
version '1.0.4'

android {
namespace 'com.frontegg.android'
Expand All @@ -15,9 +15,10 @@ android {
defaultConfig {
minSdk 26
targetSdk 33
versionName "1.0.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
versionName "$version"

}

buildTypes {
Expand Down Expand Up @@ -51,9 +52,7 @@ dependencies {
implementation 'com.google.code.gson:gson:2.8.9'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
implementation "androidx.browser:browser:1.5.0"
}

afterEvaluate {
Expand Down Expand Up @@ -96,13 +95,12 @@ afterEvaluate {
}
repositories {
maven {

name = "OSSRH"
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username = System.getenv('NEXUS_USERNAME')
password = System.getenv('NEXUS_PASSWORD')
}
name = "OSSRH"
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
}
}
}
Expand Down

This file was deleted.

6 changes: 6 additions & 0 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />
<queries>
<intent>
<action android:name="android.support.customtabs.action.CustomTabsService" />
</intent>
</queries>
</manifest>

This file was deleted.

This file was deleted.

Loading

0 comments on commit dc331e8

Please sign in to comment.