Skip to content

Commit

Permalink
added auto-incrementing of versionCode, removed stripping of native b…
Browse files Browse the repository at this point in the history
…inaries, set versionName from tag name
  • Loading branch information
ErikBjare committed Apr 14, 2019
1 parent 5e699cc commit 5c7a39d
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 12 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,22 @@ install:
- env RELEASE=false make aw-server-rust

script:
- ./gradlew clean lint test
- bundle exec fastlane test
#- ./gradlew clean lint test
#- ./gradlew connectedAndroidTest || true

before_deploy:
- openssl aes-256-cbc -K $encrypted_aac99b59139e_key -iv $encrypted_aac99b59139e_iv -in android.jks.enc -out android.jks -d
- openssl aes-256-cbc -K $encrypted_c39c3bebf85c_key -iv $encrypted_c39c3bebf85c_iv -in fastlane/api-8546008605074111507-287154-450dc77b365f.json.enc -out fastlane/api-8546008605074111507-287154-450dc77b365f.json -d
- env RELEASE=true make aw-server-rust # RUSTFLAGS=-g # The RUSTFLAGS=-g is to keep debug symbols in the build, bloats the binary from 7M -> 60MB. Currently using profile.release.debug in Cargo.toml however as -g didn't work on the first try
- make aw-webui
- sed -i "s/versionName.*/versionName \"$(echo $TRAVIS_TAG_NAME | tail -c +2 -)\"/g" mobile/build.gradle # Sets versionName, tail used to skip "v" at start of tag name
- bash scripts/build_apk.sh

deploy:
# Production version
- provider: script
script: bundle exec fastlane supply run -b aw-android*.apk
script: bundle exec fastlane supply run --track beta --apk aw-android*.apk
skip_cleanup: true
on:
tags: true
Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
source "https://rubygems.org"

gem "fastlane"

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
18 changes: 10 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ GEM
digest-crc (0.4.1)
domain_name (0.5.20180417)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.1)
dotenv (2.7.2)
emoji_regex (1.0.1)
excon (0.62.0)
excon (0.63.0)
faraday (0.15.4)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
Expand All @@ -27,7 +27,7 @@ GEM
faraday_middleware (0.13.1)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.5)
fastlane (2.117.1)
fastlane (2.120.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
babosa (>= 1.0.2, < 2.0.0)
Expand Down Expand Up @@ -56,14 +56,15 @@ GEM
security (= 0.1.3)
simctl (~> 1.6.3)
slack-notifier (>= 2.0.0, < 3.0.0)
terminal-notifier (>= 1.6.2, < 2.0.0)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.6.0, < 2.0.0)
xcodeproj (>= 1.8.1, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-increment_version_code (0.4.3)
gh_inspector (1.1.3)
google-api-client (0.23.9)
addressable (~> 2.5, >= 2.5.1)
Expand Down Expand Up @@ -98,7 +99,7 @@ GEM
memoist (0.16.0)
mime-types (3.2.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2018.0812)
mime-types-data (3.2019.0331)
mini_magick (4.5.1)
multi_json (1.13.1)
multi_xml (0.6.0)
Expand All @@ -125,7 +126,7 @@ GEM
CFPropertyList
naturally
slack-notifier (2.3.2)
terminal-notifier (1.8.0)
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
tty-cursor (0.6.1)
Expand All @@ -138,7 +139,7 @@ GEM
unf_ext (0.0.7.5)
unicode-display_width (1.5.0)
word_wrap (1.0.0)
xcodeproj (1.8.1)
xcodeproj (1.8.2)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand All @@ -154,6 +155,7 @@ PLATFORMS

DEPENDENCIES
fastlane
fastlane-plugin-increment_version_code

BUNDLED WITH
2.0.1
6 changes: 5 additions & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ platform :android do
lane :beta do
gradle(task: "clean assembleRelease")
crashlytics

# sh "your_script.sh"
# You can also use other beta testing services here
end

desc "Deploy a new version to the Google Play"
lane :deploy do
increment_version_code(
gradle_file_path: "mobile/build.gradle",
version_code: google_play_track_version_codes.max + 1
)
gradle(task: "clean assembleRelease")
upload_to_play_store
end
Expand Down
5 changes: 5 additions & 0 deletions fastlane/Pluginfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!

gem 'fastlane-plugin-increment_version_code'
39 changes: 39 additions & 0 deletions fastlane/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
fastlane documentation
================
# Installation

Make sure you have the latest version of the Xcode command line tools installed:

```
xcode-select --install
```

Install _fastlane_ using
```
[sudo] gem install fastlane -NV
```
or alternatively using `brew cask install fastlane`

# Available Actions
## Android
### android test
```
fastlane android test
```
Runs all the tests
### android beta
```
fastlane android beta
```
Submit a new Beta Build to Crashlytics Beta
### android deploy
```
fastlane android deploy
```
Deploy a new version to the Google Play

----

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).
5 changes: 4 additions & 1 deletion mobile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ android {
applicationId "net.activitywatch.android"
minSdkVersion 24
targetSdkVersion 28
versionCode 13
versionCode 14
versionName "0.4.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
packagingOptions {
doNotStrip '**/.*so'
}
}
}

Expand Down

0 comments on commit 5c7a39d

Please sign in to comment.