Skip to content

Commit

Permalink
Tooling for android releases (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arrnas committed Oct 19, 2018
1 parent fd35564 commit c619118
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 23 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Expand Up @@ -88,10 +88,10 @@ Carthage/Build
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

ios/fastlane/report.xml
ios/fastlane/Preview.html
ios/fastlane/screenshots/**/*.png
ios/fastlane/test_output
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
Expand Down
File renamed without changes.
File renamed without changes.
33 changes: 31 additions & 2 deletions android/app/build.gradle
Expand Up @@ -78,6 +78,35 @@ project.ext.react = [

apply from: "../../node_modules/react-native/react.gradle"

/**
* Get the version code from command line param
*
* @return int If the param -PversionCode is present then return int value or -1
*/
def getVersionCode = { ->

def code = project.hasProperty('versionCode') ? versionCode.toInteger() : -1

println "VersionCode is set to $code"

return code
}

/**
* Get the version name from command line param
*
* @return string If the param -PversionName is present then return string value or "0.1"
*/
def getVersionName = { ->

def name = project.hasProperty('versionName') ? versionName.toString() : "0.1"

println "VersionName is set to $name"

return name
}


/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
Expand All @@ -101,8 +130,8 @@ android {
applicationId "network.mysterium.vpn"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
versionCode getVersionCode()
versionName getVersionName()
ndk {
abiFilters "armeabi-v7a", "x86"
}
Expand Down
7 changes: 4 additions & 3 deletions ios/fastlane/Appfile → fastlane/Appfile
@@ -1,8 +1,9 @@
### Android
package_name("network.mysterium.vpn")

### iOS
app_identifier("network.mysterium.MysteriumVPN") # The bundle identifier of your app
apple_id("arrnas@gmail.com") # Your Apple email address

itc_team_id("96179937") # App Store Connect Team ID
team_id("YRSJ62FGRH") # Developer Portal Team ID

# For more information about the Appfile, see:
# https://docs.fastlane.tools/advanced/#appfile
37 changes: 37 additions & 0 deletions fastlane/Fastfile
@@ -0,0 +1,37 @@
default_platform(:ios)

platform :ios do
def bump_versions
increment_version_number(version_number: last_git_tag)
increment_build_number(build_number: number_of_commits)
end

desc "Push a new beta build to TestFlight"
lane :beta do
bump_versions
build_app(scheme: "MysteriumVPN", project: "ios/MysteriumVPN.xcodeproj")
upload_to_testflight
end
end

platform :android do
desc "Push a new beta build to Playstore"
lane :beta do
gradle(
task: "clean assembleRelease",
project_dir: "android",
print_command: false, # to prevent outputting passwords
properties: {
'versionCode' => number_of_commits,
'versionName' => last_git_tag,
"android.injected.signing.store.file" => ENV["FASTLANE_ANDROID_SIGNING_FILE_PATH"],
"android.injected.signing.store.password" => ENV["FASTLANE_ANDROID_SIGNING_KEYSTORE_PASS"],
"android.injected.signing.key.alias" => ENV["FASTLANE_ANDROID_SIGNING_KEY_ALIAS"],
"android.injected.signing.key.password" => ENV["FASTLANE_ANDROID_SIGNING_KEY_PASS"],
})
upload_to_play_store(
track: "internal",
json_key: ENV["FASTLANE_ANDROID_SECRET_JSON_PATH"]
)
end
end
9 changes: 9 additions & 0 deletions ios/fastlane/README.md → fastlane/README.md
Expand Up @@ -24,6 +24,15 @@ Push a new beta build to TestFlight

----

## Android
### android beta
```
fastlane android beta
```
Push a new beta build to Playstore

----

This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
14 changes: 0 additions & 14 deletions ios/fastlane/Fastfile

This file was deleted.

0 comments on commit c619118

Please sign in to comment.