PlayTime simplifies deploying apps to the Google Play Store.
Installation
Add this line to your application's Gemfile:
gem 'play_time'
And then execute:
$ bundle
Or install it yourself as:
$ gem install play_time
Then add the following line to your Rakefile. If you don't have a Rakefile, just create it.
require 'line_change/tasks'
Then run the rake task to create a config file.
$ rake play_time:install
# Generating a new config file: config/play_time.yml
Usage
Getting access to your Play account
First you will need a Google Play developer account. After this is setup you will need to create a Google developer project https://console.developers.google.com. This is the project that PlayTime will be using to access your Google Play developer account. Once your project is created you will need to enable the Google Play Android Developer API. And then also create a new client id as a service account. This will create and download a P12 key for you and present you with the P12 passphrase, (these will be needed below).
NOTE You should probably change this passphrase, see http://wiki.bsdserver.nl/doku.php?id=misc:ssl:sslchangepwonpkcs12cert.
Fill out all of the config fields.
package_name: # package name for your google play app
secret_path: # fill path to secret.p12
secret_passphrase: # passphrase for secert.p12
apk_path: # path to apk file
client_name: # This can be anything (as far as we can tell)
client_version: # This can be anything as well
issuer: # emaill address generated by your service account (<somestuff>@developer.gserviceaccount.com)
NOTE: The apk_path can be a regular expression and PlayTime::Apk.load will find the most recent file using mtime. mtime
is not always the most recent file and can change depending how your disk is mounted. Make sure that this is what you want. If not you can hard code your path each time you are uploading.
Check out your new rake commands:
$ rake -T
rake play_time:promote:alpha[version_code] # Promote apk version code to alpha
rake play_time:promote:beta[version_code] # Promote apk version code to beta
rake play_time:promote:production[version_code] # Promote apk version code to production
rake play_time:promote:rollout[version_code] # Promote apk version code to rollout
rake play_time:upload:alpha # Uploads apk to alpha
rake play_time:upload:beta # Uploads apk to beta
rake play_time:upload:production # Uploads apk to production
rake play_time:upload:rollout # Uploads apk to rollout
Upload
The upload namespace will attempt to upload the latest apk specified at the apk path to the track that you specify.
Promote
Promote will remove the version code from its existing track and then add that version code to the new track.
Note if the version code does not exist on a current track, it will raise an error.
Using without rake
require 'play_time'
PlayTime.install
# modify the config file
PlayTime::Track::TRACKS
> ['alpha', 'beta', 'rollout', 'production']
track = PlayTime::Track::ALPHA
PlayTime.upload(track)
PlayTime.promote(PlayTime::Track::BETA, <version_code>)
TODO
- add promotion syntax like
rake play_time:promote['alpha', 'beta']
- Add more precise steps for linking your Google Play account and Google Developer accounts.
- add nice logging to std out and/or progress bar
Contributing
- Fork it ( https://github.com/[my-github-username]/play_time/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request