Skip to content

Commit

Permalink
Merge pull request #17 from tripleblindmarket/develop
Browse files Browse the repository at this point in the history
safe paths
  • Loading branch information
alpita-masurkar authored Apr 11, 2020
2 parents c86c2ce + d06d431 commit 25bcb4d
Show file tree
Hide file tree
Showing 254 changed files with 2,765 additions and 2,288 deletions.
20 changes: 8 additions & 12 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parser": "babel-eslint",
"plugins": [
"react",
Expand All @@ -22,17 +19,19 @@
"commonjs": true,
"es6": true,
"react-native/react-native": true,
"node": true
"node": true,
"jest": true
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": { // 0 is for off, 1 is for warning, 2 is for error
"rules": {
// 0 is for off, 1 is for warning, 2 is for error
"eol-last": 2, // Require file to end with single newline
"no-constant-condition": 2, // Disallow use of constant expressions in conditions
"no-dupe-keys": 2, // Disallow Duplicate Keys
"no-dupe-keys": 2, // Disallow Duplicate Keys
"no-empty": 2, // Disallow Empty Block Statements
"no-extra-boolean-cast": 2, // Disallow Extra Boolean Casts
"no-prototype-builtins": 2, // Disallow use of Object.prototypes builtins directly
Expand All @@ -43,10 +42,7 @@
"no-useless-escape": 2, // Disallow unnecessary escape usage
"no-console": 0, // disallow the use of console
"no-var": 2, // require let or const instead of var
"strict": [
2,
"global"
], // require or disallow strict mode directives
"strict": [2, "global"], // require or disallow strict mode directives
"react-native/no-color-literals": 1, // Detect StyleSheet rules and inline styles containing color literals instead of variables
"react-native/no-inline-styles": 0, // For keeping styles away from the logic, we can switch it to 1 in future
"react-native/no-raw-text": 1, // This is to make sure everything is translated in the app
Expand All @@ -66,4 +62,4 @@
"react/react-in-jsx-scope": 2, // Prevent missing React when using JSX
"react/self-closing-comp": 2 // Prevent extra closing tags for components without children
}
}
}
36 changes: 0 additions & 36 deletions .github/workflows/build-android.yml

This file was deleted.

54 changes: 0 additions & 54 deletions .github/workflows/build-ios.yml

This file was deleted.

92 changes: 92 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build

on:
push:
branches: [develop]
pull_request:
branches: [develop]

jobs:
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Cache node_modules/
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-yarn-cache-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-cache-
- run: yarn --frozen-lockfile

- name: Cache gradle
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Increase max file watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- name: Bundle JS
run: npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/ --verbose

- name: Build APK (gradle)
run: ./gradlew assembleDebug --no-daemon
working-directory: ./android

- name: Upload APK
uses: actions/upload-artifact@v1
with:
name: Debug APK
path: android/app/build/outputs/apk/debug/app-debug.apk

build-ios:
runs-on: macOS-latest
steps:
- uses: actions/checkout@master

- name: Set XCode Version
run: sudo xcode-select -s /Applications/Xcode_11.app

- name: Cache node_modules/
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-yarn-cache-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-cache-
- run: yarn --frozen-lockfile

- run: gem install cocoapods

- name: Cache CocoaPods
uses: actions/cache@v1
with:
path: ios/Pods
key: ${{ runner.OS }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.OS }}-pods-
- run: pod install --repo-update
working-directory: ./ios

- name: Bundle iOS JS
run: npx react-native bundle --dev false --entry-file index.js --bundle-output ios/main.jsbundle --platform ios --verbose
# - name: Build App
# # xcodebuild -workspace PrivateKit.xcworkspace -configuration Debug -scheme PrivateKit
# # xcodebuild -workspace PrivateKit.xcworkspace -scheme PrivateKit archive -archivePath PrivateKit.xcarchive -allowProvisioningUpdates
# # xcodebuild -exportArchive -archivePath ./PrivateKit.xcarchive -exportPath . -exportOptionsPlist PrivateKit/Info.plist
# run: xcodebuild -workspace PrivateKit.xcworkspace -scheme PrivateKit archive -archivePath PrivateKit.xcarchive -allowProvisioningUpdates
# working-directory: ./ios
# - name: Upload Artifact
# uses: actions/upload-artifact@v1
# with:
# name: Debug IPA
# path: ios/build/
93 changes: 93 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Create Release Assets

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache node_modules/
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-yarn-cache-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-cache-
- run: yarn --frozen-lockfile

- name: Setup kernel for react native, increase watchers for release versions.
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- name: Cache gradle
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build AAB
run: ./gradlew clean bundleRelease --stacktrace
working-directory: ./android

- name: Sign AAB
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: android/app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Build APK
run: ./gradlew assembleRelease --stacktrace --no-daemon
working-directory: ./android

- name: Sign APK
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: android/app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload APK Asset
id: upload-release-asset-apk
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: android/app/build/outputs/apk/release/app-release-unsigned-signed.apk
asset_name: app-release-${{ github.ref }}.apk
asset_content_type: application/zip

- name: Upload AAB Asset
id: upload-release-asset-aab
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: android/app/build/outputs/bundle/release/app.aab
asset_name: app-release-${{ github.ref }}.aab
asset_content_type: application/zip
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint

on:
push:
branches: [develop]
pull_request:
branches: [develop]

jobs:
diffs-pass-eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Cache node_modules/
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-yarn-cache-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-cache-
- run: yarn --frozen-lockfile

- run: ./node_modules/.bin/lint-diff origin/develop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Unit test
name: Test

on:
push:
Expand All @@ -7,15 +7,12 @@ on:
branches: [ develop ]

jobs:
build:
# strategy:
# matrix:
# node-version: [12, 13] # TODO

unit-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- run: node --version

- name: Cache node_modules/
Expand Down
Loading

0 comments on commit 25bcb4d

Please sign in to comment.