Skip to content

Commit

Permalink
Merge pull request #9 from frontegg/FR-14813-multi-region-bug-fixes
Browse files Browse the repository at this point in the history
FR-14813 - fix pipeline
  • Loading branch information
frontegg-david authored Jan 8, 2024
2 parents 9703b51 + 0f5c337 commit 7365120
Show file tree
Hide file tree
Showing 17 changed files with 13,031 additions and 5,837 deletions.
17 changes: 17 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Setup
description: Setup Node.js and install dependencies

runs:
using: composite
steps:
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
cache: npm
cache-dependency-path: '**/package.json'

- name: Install dependencies
run: |
npm ci
shell: bash
51 changes: 0 additions & 51 deletions .github/workflows/onBuild.yaml

This file was deleted.

124 changes: 124 additions & 0 deletions .github/workflows/onPullRequestMerged.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Pull Request Merge Workflow
on:
pull_request:
branches:
- master
types: [ closed ]
env:
CI: true
jobs:
lint-build:
name: 'Lint | Build'
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Lint files
run: npm run lint

- name: Check licenses
id: check_licenses
run: |
npm install -g license-checker
license-checker --failOn "AGPL-1.0-only;AGPL-1.0-or-later;AGPL-3.0-only;AGPL-3.0-or-later;GPL-1.0-only;GPL-1.0-or-later;GPL-2.0-only;GPL-2.0-or-later;GPL-3.0-only;GPL-3.0-or-later;LGPL-2.0-only;LGPL-2.0-or-later;LGPL-2.1-only;LGPL-2.1-or-later;LGPL-3.0-only;LGPL-3.0-or-later;LGPLLR;MPL-1.1"
- name: Build Package
run: |
npm run build
createReleasePullRequest:
if: "!contains(join(github.event.pull_request.labels.*.name, ','), 'Release') && github.event.pull_request.merged == true"
name: 'Create Release Pull Request'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Git Identity
run: |
git config --global user.name 'frontegg'
git config --global user.email '[email protected]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Authenticate with Registry
run: |
echo "init-author-name=Frontegg LTD" > .npmrc
echo "[email protected]" >> .npmrc
echo "init-author-url=https://frontegg.com" >> .npmrc
echo "init-license=MIT" >> .npmrc
echo "always-auth=true" >> .npmrc
echo "registry=https://registry.npmjs.org" >> .npmrc
echo "_authToken=$NPM_TOKEN" >> .npmrc
echo "@frontegg:registry=https://registry.npmjs.org" >> .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
npm whoami
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Commit Version UP
run: |
npm version --patch --no-git-tag-version --no-commit-hooks
- name: "Set incremented version"
uses: actions/github-script@v6
id: 'incremented-version'
with:
result-encoding: string
script: |
const {default: fs} = await import('fs');
const {version} = JSON.parse(fs.readFileSync('./package.json', {encoding: "utf-8"}));
return version;
- name: Commit changes
shell: bash -ex {0}
run: |
git add . && git commit -m "chore(release): publish ${{ steps.incremented-version.outputs.result }}"
- name: Create Release Pull Request
id: cpr
uses: peter-evans/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: ${{ secrets.GITHUB_WORKSPACE }}
commit-message: "Update v${{ steps.incremented-version.outputs.result }}"
committer: GitHub <[email protected]>
author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
title: 'v${{ steps.incremented-version.outputs.result }}'
body: |
# v${{ steps.incremented-version.outputs.result }}
labels: "Type: Release"
branch: "release/next"

- name: Publish Pre-Release version to NPM
id: publish_pre_release_version
run: |
version=$(node -p 'require("./package.json").version')
echo "::set-output name=LIB_VERSION::${version}"
echo "Publishing DEV version - v${version}-alpha.${{ github.run_id }}"
yarn version --new-version "${version}-alpha.${{ github.run_id }}" --no-git-tag-version --no-commit-hooks
git add .
git commit -m "chore: prelrease version"
npm run build
npm publish --tag next
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

# - name : Notify Slack on alpha version deployment
# uses : rtCamp/action-slack-notify@v2
# env :
# SLACK_CHANNEL : frontegg-alpha-versions
# SLACK_COLOR : ${{ job.status }}
# SLACK_ICON : https://avatars.githubusercontent.com/u/67857107?s=40&v=4
# SLACK_MESSAGE : '${{ steps.publish_pre_release_version.outputs.LIB_VERSION }}-alpha.${{ github.run_id }} has been released :rocket:'
# SLACK_TITLE : 'A new @frontegg/ionic-capacitor alpha version!'
# SLACK_USERNAME : ${{ github.actor }}
# SLACK_WEBHOOK : ${{ secrets.ROTEM_SLACK_WEBHOOK }}
# MSG_MINIMAL : true
32 changes: 32 additions & 0 deletions .github/workflows/onPush.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Push Workflow
on:
# When commit pushed to branches not master nad release/next
push:
branches-ignore:
- 'master'
- 'release/next'
env:
CI: true
jobs:
lint-build:
name: 'Lint | Build'
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Lint files
run: npm run lint

- name: Check licenses
id: check_licenses
run: |
npm install -g license-checker
license-checker --failOn "AGPL-1.0-only;AGPL-1.0-or-later;AGPL-3.0-only;AGPL-3.0-or-later;GPL-1.0-only;GPL-1.0-or-later;GPL-2.0-only;GPL-2.0-or-later;GPL-3.0-only;GPL-3.0-or-later;LGPL-2.0-only;LGPL-2.0-or-later;LGPL-2.1-only;LGPL-2.1-or-later;LGPL-3.0-only;LGPL-3.0-or-later;LGPLLR;MPL-1.1"
- name: Build Package
run: |
npm run build
91 changes: 44 additions & 47 deletions .github/workflows/onReleaseMerged.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
name: Release Merge Workflow
on:
push:
pull_request:
branches:
- master
types: [ closed ]
env:
CI: true
jobs:
publish:
name: 'Install | Build | Test'
if: "contains(join(github.event.pull_request.labels.*.name, ','), 'Release') && github.event.pull_request.merged == true"
name: 'Build | Publish'
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
cache: npm
cache-dependency-path: '**/package.json'
- name: Setup
uses: ./.github/actions/setup

- name: Git Identity
run: |
git config --global user.name 'frontegg'
Expand All @@ -39,9 +38,10 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

- name: Install Package
- name: Build Packages
run: |
npm i
npm run build
- name: Set Current Version
id: set_current_version
if: startsWith(github.event.pull_request.title, 'v')
Expand All @@ -63,47 +63,44 @@ jobs:
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Create Git Tag
# if: steps.tag_check.outputs.exists_tag == 'false'
# uses: azu/action-package-version-to-git-tag@v1
# with:
# version: ${{ steps.set_current_version.outputs.CURRENT_VERSION }}
# github_token: ${{ secrets.GITHUB_TOKEN }}
# github_repo: ${{ github.repository }}
# git_commit_sha: ${{ github.sha }}
# git_tag_prefix: "v"

# - name: Create Release
# id: create_release
# if: steps.tag_check.outputs.exists_tag == 'false'
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: v${{ steps.set_current_version.outputs.CURRENT_VERSION }}
# release_name: ${{ github.event.pull_request.title }}
# body: |
# ${{ github.event.pull_request.body }}
# draft: false
# prerelease: false

- name: Publish @frontegg/ionic-capacitor version to NPM
- name: Create Git Tag
if: steps.tag_check.outputs.exists_tag == 'false'
uses: azu/action-package-version-to-git-tag@v1
with:
version: ${{ steps.set_current_version.outputs.CURRENT_VERSION }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repo: ${{ github.repository }}
git_commit_sha: ${{ github.sha }}
git_tag_prefix: "v"
- name: Create Release
id: create_release
if: steps.tag_check.outputs.exists_tag == 'false'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.set_current_version.outputs.CURRENT_VERSION }}
release_name: ${{ github.event.pull_request.title }}
body: |
${{ github.event.pull_request.body }}
draft: false
prerelease: false
- name: Publish @frontegg/react-native version to NPM
run: npm publish --tag latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
# - name: Notify Slack on deployment
# uses: rtCamp/action-slack-notify@v2
# env:
# SLACK_CHANNEL: Production
# SLACK_COLOR: ${{ job.status }}
# SLACK_ICON: https://avatars.githubusercontent.com/u/67857107?s=40&v=4
# SLACK_MESSAGE: '${{ github.actor }} has deployed @frontegg/react-native version: ${{ steps.set_current_version.outputs.CURRENT_VERSION }} :rocket:'
# SLACK_TITLE: '@frontegg/react-native version: ${{ steps.set_current_version.outputs.CURRENT_VERSION }} has been successfully published'
# SLACK_USERNAME: ${{ github.actor }}
# SLACK_WEBHOOK: ${{ secrets.SLACK_PRODUCTION_TOKEN }}
# MSG_MINIMAL: Commit,actions url
- name: Notify Slack on deployment
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: Production
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: https://avatars.githubusercontent.com/u/67857107?s=40&v=4
SLACK_MESSAGE: '${{ github.actor }} has deployed @frontegg/react-native version: ${{ steps.set_current_version.outputs.CURRENT_VERSION }} :rocket:'
SLACK_TITLE: '@frontegg/react-native version: ${{ steps.set_current_version.outputs.CURRENT_VERSION }} has been successfully published'
SLACK_USERNAME: ${{ github.actor }}
SLACK_WEBHOOK: ${{ secrets.SLACK_PRODUCTION_TOKEN }}
MSG_MINIMAL: Commit,actions url
- uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
Expand Down
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
build
dist

.*

example

android
ios
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dependencies {
implementation "androidx.browser:browser:1.5.0"
implementation 'io.reactivex.rxjava3:rxkotlin:3.0.1'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'com.frontegg.sdk:android:1.2.2'
implementation 'com.frontegg.sdk:android:1.2.3'

testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public void load() {

// for regions initialization
List<RegionConfig> regions = new ArrayList<>();
boolean useAssetLinks = this.getConfig().getBoolean("useAssetsLinks", true);
JSONArray array;
try {
array = this.getConfig().getConfigJSON().optJSONArray("regions");
Expand Down Expand Up @@ -74,10 +75,11 @@ public void load() {
FronteggApp.Companion.init(
baseUrl,
clientId,
this.getContext()
this.getContext(),
useAssetLinks
);
}else {
FronteggApp.Companion.initWithRegions(regions, this.getContext());
FronteggApp.Companion.initWithRegions(regions, this.getContext(), useAssetLinks);
}

FronteggAuth auth = FronteggAuth.Companion.getInstance();
Expand Down
Loading

0 comments on commit 7365120

Please sign in to comment.