Skip to content

Commit

Permalink
ci(travis): upgrade release process; add metadata validation job
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutoshgngwr committed May 23, 2020
1 parent a4c2647 commit 9f2d70c
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 50 deletions.
50 changes: 30 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ language: minimal
branches:
only:
- master
- /^\d+\.\d+\.\d+(-\w+)?$/
- /^\d+\.\d+\.x$/ # build patch branches. see CONTRIBUTING.md Releases section.
- /^\d+\.\d+\.\d+$/ # build tags

addons:
apt:
Expand All @@ -18,6 +19,11 @@ addons:
- bridge-utils
- openjdk-8-jdk

stages:
- name: test
- name: deploy
if: tag IS present

env:
global:
- COMPILE_SDK="29"
Expand Down Expand Up @@ -48,11 +54,6 @@ install:
- echo y | sdkmanager --sdk_root="$ANDROID_HOME" "tools" > /dev/null
- echo y | sdkmanager "platform-tools" "emulator" "platforms;android-$COMPILE_SDK" "build-tools;$BUILD_TOOLS" > /dev/null

stages:
- name: test
- name: deploy
if: tag IS present

before_script:
- echo y | sdkmanager "system-images;$TEST_PLATFORM;default;x86" > /dev/null
- echo no | avdmanager create avd -f -n "$TEST_PLATFORM" -k "system-images;$TEST_PLATFORM;default;x86" -c 500M
Expand All @@ -70,6 +71,20 @@ before_script:
script: ./gradlew connectedAndroidTest
after_success: bash <(curl -s https://codecov.io/bash)

_fastlane-config: &fastlane-config
env:
- secure: "Om5/jAc2a/paKPtYosO++UMi0gWC6F5BuHftxWMYaeYQbK3Y07r8K+OmvfzXq+rWtiiuK3fOaDjZGciI4zmx9U5cLgdfTFSUqqKkrvDeP9YgOJ5Etn5a0ody2IdfqHeuSOrr3FLnEna58IunMhicC/F8b5x6aRvksuHypU2YN4u5vaDILXIzIJfD9s7xW71h4+G+Z7EZNNvtbp9SakA/2uJMLJYeLdFyDOPuhDpgLnMW44cQQRPDHBANpcix3tml4eF1x5AuNHYvTbZkmvDsK4juHPD6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Y/xIyOXEigNRY="
- secure: "WoqEzeeN8G9hEEuKlIeMiM7tVc7fPrAEIAp8bK2aN9qpA/nJWgU/FhzvODAE4rue0LJTWk74nfJbENPHFUL9cCQA0WscJbVTzuxTXQruyn32dXh2XGbuLHQeVc43PQna/lk8b7EwwgwvqD1lU1fA70TfT85Q54ZTyQAE4WRN+WQ3bAZCW6VjQSBz4Tb8xIH7VFzRFEFLR58wqFf3bMJ6rehS5xarR4UBI6siHfBD79ICyvYbuyPQo3y5hvv2WOrBA6L/9VJAOfY3PjItVX+kHDfRKKLdGlBX88zfpUzw9Eqivii6W7igt8wGs7U81JVbsXRZmvr55hvnRPrwW0+WlzmtqIlpcU04qVwOU1KkbawM3t/eS0e7qiXk1CK0rPRbAKfOGbrSagfvv/aTNovlN3G60emafPip+5TNYGFQOAA3LI59INp9QfUT7PcIe6bt8MlgE+JQRxHDjzGoZm74pjmj3Z09SVmxkrNhY/VzasWy87pAgtXuJaN/Z2W/XQ/2BS/O2UezrL5HV0UHP6mOeclb3lSEdm3x1vrH/3NRby6h01TQbh6jliPwzqvxUPH7lqJLO73H0WobclD/IQTkvobhf0UPsX4oWzQ+bLe/D19R2DL7o6twlvGpMhXsD90JYYM75bY9brMCQtgT4XX5Gwi/dtZeNY+fpNJcMfVo7NQ="
before_script:
- gem update --system
- gem install bundler
- bundle install
- openssl aes-256-cbc -K $encrypted_00dbe7dde1b1_key -iv $encrypted_00dbe7dde1b1_iv -in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar
after_script: rm keystore.jks service-account-key.json secrets.tar
after_success: skip # no coverage report after success

jobs:
fast_finish: true
allow_failures:
Expand All @@ -78,21 +93,16 @@ jobs:
- env: TEST_PLATFORM=android-27
- env: TEST_PLATFORM=android-28
include:
- stage: deploy
- <<: *fastlane-config
stage: test
env:
- secure: "Om5/jAc2a/paKPtYosO++UMi0gWC6F5BuHftxWMYaeYQbK3Y07r8K+OmvfzXq+rWtiiuK3fOaDjZGciI4zmx9U5cLgdf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bS5Z1HlipKhxM7xnkMKVwhrrRoUaFxqyh3+iRtyNuCNYcImkcR6gNoaTDJs5hM0ZTw++Oa/QUeGlIcm3g5GvlW8LabPlcLVWJAyqDxQgJwRhie9f+iITRZTtdGMxgA+jz7G6nJcMk7OBGUMJ9tN/uHx8bwSggpco+VnDjINnJDHliriHk/drqBa7b7wY/xIyOXEigNRY="
- secure: "WoqEzeeN8G9hEEuKlIeMiM7tVc7fPrAEIAp8bK2aN9qpA/nJWgU/FhzvODAE4rue0LJTWk74nfJbENPHFUL9cCQA0WscJbVTzuxTXQruyn32dXh2XGbuLHQeVc43PQna/lk8b7EwwgwvqD1lU1fA70TfT85Q54ZTyQAE4WRN+WQ3bAZCW6VjQSBz4Tb8xIH7VFzRFEFLR58wqFf3bMJ6rehS5xarR4UBI6siHfBD79ICyvYbuyPQo3y5hvv2WOrBA6L/9VJAOfY3PjItVX+kHDfRKKLdGlBX88zfpUzw9Eqivii6W7igt8wGs7U81JVbsXRZmvr55hvnRPrwW0+WlzmtqIlpcU04qVwOU1KkbawM3t/eS0e7qiXk1CK0rPRbAKfOGbrSagfvv/aTNovlN3G60emafPip+5TNYGFQOAA3LI59INp9QfUT7PcIe6bt8MlgE+JQRxHDjzGoZm74pjmj3Z09SVmxkrNhY/VzasWy87pAgtXuJaN/Z2W/XQ/2BS/O2UezrL5HV0UHP6mOeclb3lSEdm3x1vrH/3NRby6h01TQbh6jliPwzqvxUPH7lqJLO73H0WobclD/IQTkvobhf0UPsX4oWzQ+bLe/D19R2DL7o6twlvGpMhXsD90JYYM75bY9brMCQtgT4XX5Gwi/dtZeNY+fpNJcMfVo7NQ="
before_script:
- gem update --system
- gem install bundler
- bundle install
- export TRACK=beta
- if [ -z "$(echo $TRAVIS_TAG | grep -P '^\d+\.\d+\.\d+-\w+$')" ]; then export TRACK=production; fi
- openssl aes-256-cbc -K $encrypted_00dbe7dde1b1_key -iv $encrypted_00dbe7dde1b1_iv -in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar
script: bundle exec fastlane $TRACK
after_script: rm keystore.jks service-account-key.json secrets.tar
# only here to indicate the jobs name, isn't used anywhere
- TEST_PLATFORM="fastlane-metadata"
install: skip
script: bundle exec fastlane validate
- <<: *fastlane-config
stage: deploy
script: bundle exec fastlane beta

notifications:
email: false
26 changes: 16 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,29 @@ changes is necessary to prepare a new release.
### Play Store

Noice uses [Travis CI](https://travis-ci.com/github/ashutoshgngwr/noice) for automatically
building and pushing releases to Google Play store. All releases happen in two stages.
building and pushing releases to Google Play store. ~~All releases happen in two stages.~~

- First, a candidate release is pushed to the beta track on the Play Store. Git tags for
- ~~First, a candidate release is pushed to the beta track on the Play Store. Git tags for
these are marked with format `0.0.0-rc`. This job pushes the new binary and its changelog
to the Play Store.
- After ample time, the release candidates are promoted to production track on the Play
to the Play Store.~~
- ~~After ample time, the release candidates are promoted to production track on the Play
Store. Git tags for these are marked with format `0.0.0`. This job promotes the latest
beta release to the production track on the Play Store. It also updates the Fastlane metadata
in the Play Store listing.

_**Note:** A beta release should be followed by its production release. If a new beta release
in the Play Store listing.~~
- All releases tagged in Git repository are pushed to beta track on the Play Store. After ample
time, a release is manually promoted to production track for general availability.
- In case a feature is merged into the master branch and a patch release needs to be created for
the latest public release, create a temporary branch with pattern `Major.Minor.x` e.g., `1.1.x`.
Tag any further patch releases to a commit in this branch. Before next _non-patch_ release, the
temporary branch can be merged into master.

~~_**Note:** A beta release should be followed by its production release. If a new beta release
is created before the production release of the last beta release, the last beta release must
be manually promoted to the production track from the Play Console._
be manually promoted to the production track from the Play Console._~~

### F-Droid

F-Droid releases are picked by its builder based on the latest tag. F-Droid doesn't pick
the beta releases.
F-Droid releases are picked by its builder based on the latest tag. ~~F-Droid doesn't pick
the beta releases.~~
See [the metadata file](https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/com.github.ashutoshgngwr.noice.yml)
for more information.
22 changes: 8 additions & 14 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,18 @@
default_platform(:android)

platform :android do
desc "Deploy a new beta version to the Google Play"
lane :beta do
gradle(task: "clean bundleRelease")
desc "Validate metadata with Google Play"
lane :validate do
upload_to_play_store(
track: 'beta',
skip_upload_metadata: true,
skip_upload_images: true,
skip_upload_screenshots: true
validate_only: true,
skip_upload_changelogs: true
)
end

desc "Deploy a new production version to the Google Play"
lane :production do
upload_to_play_store(
track: 'beta',
track_promote_to: 'production',
skip_upload_changelogs: true
)
desc "Deploy a new version to the beta track on the Google Play"
lane :beta do
gradle(task: "clean bundleRelease")
upload_to_play_store(track: 'beta')
end

end
12 changes: 6 additions & 6 deletions fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ or alternatively using `brew cask install fastlane`

# Available Actions
## Android
### android beta
### android validate
```
fastlane android beta
fastlane android validate
```
Deploy a new beta version to the Google Play
### android production
Validate metadata with Google Play
### android beta
```
fastlane android production
fastlane android beta
```
Deploy a new production version to the Google Play
Deploy a new version to the beta track on the Google Play

----

Expand Down

0 comments on commit 9f2d70c

Please sign in to comment.