Skip to content

Commit

Permalink
feat: update the Fastlane flows (#139)
Browse files Browse the repository at this point in the history
* refactor: delete base Fastlane env files

* feat: iOS Fastlane config

* feat: android Fastlane config

* refactor: update some logic
  • Loading branch information
tsyirvo authored Dec 27, 2020
1 parent 9ff7e00 commit 129db04
Show file tree
Hide file tree
Showing 30 changed files with 894 additions and 489 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ buck-out/
*/fastlane/Preview.html
*/fastlane/screenshots
*/fastlane/README.md
*/fastlane/.env

# Bundle artifact
*.jsbundle
Expand Down Expand Up @@ -82,4 +83,7 @@ android/app/*/release/*.aab
ios/*.dSYM.zip

# react-native-config codegen
ios/tmp.xcconfig
ios/tmp.xcconfig

# Play store
android/api-*
47 changes: 47 additions & 0 deletions .versionrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
const iOSVersionRegexp = /(<key>CFBundleShortVersionString<\/key>\s*?<string>)(\d+\.\d+\.\d+)(<\/string>)/;
const androidVersionRegexp = /(versionName ")(\d+\.\d+\.\d+)(")/;

const regexpUpdater = (regexp) => {
return {
readVersion: (content) => {
const match = content.match(regexp);

if (!match) {
throw new Error('Could not read version from project');
}

return match[2];
},
writeVersion: (content, version) => {
return content.replace(regexp, `$1${version}$3`);
},
};
};

const iOSUpdater = regexpUpdater(iOSVersionRegexp);
const androidUpdater = regexpUpdater(androidVersionRegexp);

module.exports = {
releaseCommitMessageFormat: 'chore(release): v{{currentTag}} [skip ci]',
bumpFiles: [
{
filename: 'package.json',
},
{
filename: 'ios/development-Info.plist',
updater: iOSUpdater,
},
{
filename: 'ios/staging-Info.plist',
updater: iOSUpdater,
},
{
filename: 'ios/rnStarter/Info.plist',
updater: iOSUpdater,
},
{
filename: 'android/app/build.gradle',
updater: androidUpdater,
},
],
};
15 changes: 0 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +0,0 @@
# Changelog

All notable changes to this project will be documented in this file.

# 1.1.0 iOS Production (2020-09-14)

### Features

- update the versionning handling for iOS ([ba94615](https://github.com/tsyirvo/react-native-starter/commit/ba9461535860a94d2ea28e5f493a9bf2c33e63e2))# 1.1.0 - Android Production (2020-09-14)

# 1.1.0 Android Production (2020-09-14)

### Features

- add Fastlane versionning for Android ([245a276](https://github.com/tsyirvo/react-native-starter/commit/245a276e7b9ff3784393e40b9e80d09d7d85734a))
121 changes: 69 additions & 52 deletions android/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,58 +1,75 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.2)
CFPropertyList (3.0.3)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
atomos (0.1.3)
babosa (1.0.3)
aws-eventstream (1.1.0)
aws-partitions (1.413.0)
aws-sdk-core (3.110.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.40.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.87.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.2)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
claide (1.0.3)
colored (1.2)
colored2 (3.1.2)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
declarative (0.0.10)
declarative (0.0.20)
declarative-option (0.1.0)
digest-crc (0.4.1)
digest-crc (0.6.3)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.5)
emoji_regex (1.0.1)
excon (0.72.0)
faraday (0.17.3)
dotenv (2.7.6)
emoji_regex (3.2.1)
excon (0.78.1)
faraday (1.2.0)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
ruby2_keywords
faraday-cookie_jar (0.0.7)
faraday (>= 0.8.0)
http-cookie (~> 1.0.0)
faraday_middleware (0.13.1)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.7)
fastlane (2.141.0)
faraday_middleware (1.0.0)
faraday (~> 1.0)
fastimage (2.2.0)
fastlane (2.170.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
babosa (>= 1.0.2, < 2.0.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.3, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored
commander-fastlane (>= 4.4.6, < 5.0.0)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 2.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 1.0.0)
faraday (~> 0.17)
faraday (~> 1.0)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 0.13.1)
faraday_middleware (~> 1.0)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-api-client (>= 0.29.2, < 0.37.0)
google-api-client (>= 0.37.0, < 0.39.0)
google-cloud-storage (>= 1.15.0, < 2.0.0)
highline (>= 1.7.2, < 2.0.0)
json (< 3.0.0)
jwt (~> 2.1.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multi_xml (~> 0.5)
multipart-post (~> 2.0.0)
plist (>= 3.1.0, < 4.0.0)
public_suffix (~> 2.0.0)
rubyzip (>= 1.3.0, < 2.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
slack-notifier (>= 2.0.0, < 3.0.0)
Expand All @@ -64,12 +81,11 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-appcenter (1.9.0)
fastlane-plugin-increment_version_code (0.4.3)
fastlane-plugin-appcenter (1.11.0)
fastlane-plugin-semantic_release (1.12.0)
fastlane-plugin-versioning_android (0.1.0)
gh_inspector (1.1.3)
google-api-client (0.36.4)
google-api-client (0.38.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.9)
httpclient (>= 2.8.1, < 3.0)
Expand All @@ -80,76 +96,78 @@ GEM
google-cloud-core (1.5.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.3.0)
faraday (~> 0.11)
google-cloud-errors (1.0.0)
google-cloud-storage (1.25.1)
google-cloud-env (1.4.0)
faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.0.1)
google-cloud-storage (1.29.2)
addressable (~> 2.5)
digest-crc (~> 0.4)
google-api-client (~> 0.33)
google-cloud-core (~> 1.2)
googleauth (~> 0.9)
mini_mime (~> 1.0)
googleauth (0.10.0)
faraday (~> 0.12)
googleauth (0.14.0)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.12)
signet (~> 0.14)
highline (1.7.10)
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
json (2.3.0)
jwt (2.1.0)
jmespath (1.4.0)
json (2.5.1)
jwt (2.2.2)
memoist (0.16.2)
mini_magick (4.10.1)
mini_magick (4.11.0)
mini_mime (1.0.2)
multi_json (1.14.1)
multi_xml (0.6.0)
multi_json (1.15.0)
multipart-post (2.0.0)
nanaimo (0.2.6)
nanaimo (0.3.0)
naturally (2.2.0)
os (1.0.1)
os (1.1.1)
plist (3.5.0)
public_suffix (2.0.5)
public_suffix (4.0.6)
rake (13.0.3)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rouge (2.0.7)
rubyzip (1.3.0)
ruby2_keywords (0.0.2)
rubyzip (2.3.0)
security (0.1.3)
signet (0.12.0)
signet (0.14.0)
addressable (~> 2.3)
faraday (~> 0.9)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.7)
simctl (1.6.8)
CFPropertyList
naturally
slack-notifier (2.3.2)
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
tty-cursor (0.7.1)
tty-screen (0.7.1)
tty-screen (0.8.1)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.6)
unicode-display_width (1.6.1)
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
word_wrap (1.0.0)
xcodeproj (1.14.0)
xcodeproj (1.19.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.6)
nanaimo (~> 0.3.0)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.0)
Expand All @@ -161,9 +179,8 @@ PLATFORMS
DEPENDENCIES
fastlane
fastlane-plugin-appcenter
fastlane-plugin-increment_version_code
fastlane-plugin-semantic_release
fastlane-plugin-versioning_android

BUNDLED WITH
2.1.4
2.2.3
4 changes: 2 additions & 2 deletions android/app/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ android_library(

android_build_config(
name = "build_config",
package = "com.rnstarter",
package = "ninja.gab.rnStarter",
)

android_resource(
name = "res",
package = "com.rnstarter",
package = "ninja.gab.rnStarter",
res = "src/main/res",
)

Expand Down
20 changes: 7 additions & 13 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,6 @@ def jscFlavor = 'org.webkit:android-jsc-intl:+'
*/
def enableHermes = project.ext.react.get("enableHermes", false);

def verName = "1.0.0"

if (project.hasProperty("vname")) {
verName = vname
}

android {
compileSdkVersion rootProject.ext.compileSdkVersion

Expand All @@ -147,14 +141,14 @@ android {
}

defaultConfig {
applicationId "com.rnstarter"
applicationId "ninja.gab.rnStarter"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName verName
versionCode 26817803
versionName "1.0.0"
multiDexEnabled true

resValue "string", "build_config_package", "com.rnstarter"
resValue "string", "build_config_package", "ninja.gab.rnStarter"

// Detox config
testBuildType System.getProperty('testBuildType', 'debug') // This will later be used to control the test apk build type
Expand Down Expand Up @@ -187,17 +181,17 @@ android {
productFlavors {
development {
applicationIdSuffix 'development'
resValue "string", "build_config_package", "com.rnstarter"
resValue "string", "build_config_package", "ninja.gab.rnStarter"
resValue "string", "CodePushDeploymentKey", project.env.get("ANDROID_CODEPUSH_KEY", "")
}
staging {
applicationIdSuffix 'staging'
resValue "string", "build_config_package", "com.rnstarter"
resValue "string", "build_config_package", "ninja.gab.rnStarter"
resValue "string", "CodePushDeploymentKey", project.env.get("ANDROID_CODEPUSH_KEY", "")
}
production {
applicationIdSuffix ''
resValue "string", "build_config_package", "com.rnstarter"
resValue "string", "build_config_package", "ninja.gab.rnStarter"
resValue "string", "CodePushDeploymentKey", project.env.get("ANDROID_CODEPUSH_KEY", "")
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
# Add any project specific keep options here:
-keep class com.facebook.hermes.unicode.** { *; }
-keep class com.facebook.jni.** { *; }
-keep class com.rnstarter.BuildConfig { *; }
-keep class ninja.gab.rnStarter.BuildConfig { *; }
-keepresources string/build_config_package
Loading

0 comments on commit 129db04

Please sign in to comment.