Skip to content
Snippets Groups Projects
Unverified Commit a084f45d authored by mueller-ma's avatar mueller-ma Committed by GitHub
Browse files

Autobump version and push tag for fdroid (#705)


When creating a tag, travis...
* bumps version name and code
* builds store descriptions
* commits both
* creates a tag with the suffix "-fdroid"
* pushes the tag to github

F-Droid will build a new apk on every "-fdroid" tag.

Signed-off-by: default avatarmueller-ma <mueller-ma@users.noreply.github.com>
parent ce6990a7
Branches
No related tags found
No related merge requests found
......@@ -17,3 +17,7 @@ local.properties
# macOS clutter
.DS_Store
# Fastlane docs and logs
fastlane/README.md
fastlane/report.xml
......@@ -42,6 +42,7 @@ before_script:
- android list target
script:
- bash travis/bump-versioncode.sh
- ./gradlew build connectedCheck test jacocoTestReport
- bash assets/store_descriptions/generate_and_validate.sh
......@@ -49,11 +50,7 @@ after_success:
- bash <(curl -s https://codecov.io/bash)
before_deploy:
- git config --local user.name "TravisCI"
- git config --local user.email "support@openhab.org"
- git add fastlane/*
- git commit -m "Update fastlane metadata"
#- git push origin :refs/heads/master
- bash travis/commit-version-and-metadata.sh
- openssl aes-256-cbc -K $encrypted_903a93ed2309_key -iv $encrypted_903a93ed2309_iv
-in keystore.enc -out keystore -d
- cp $TRAVIS_BUILD_DIR/keystore $HOME
......
File mode changed from 100644 to 100755
json_key_file "" # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
package_name "org.openhab.habdroid"
# Customize this file, documentation can be found here:
# https://docs.fastlane.tools/actions/
# All available actions: https://docs.fastlane.tools/actions
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# If you want to automatically update fastlane if a new version is available:
# update_fastlane
# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "2.69.3"
# Opt out of sending metrics and crash reports
opt_out_usage
opt_out_crash_reporting
default_platform :android
platform :android do
desc "Deploy a new version to the Google Play"
lane :deploy do
upload_to_play_store(
track: 'production',
apk: "$HOME/apks_to_deploy/openhab-android.apk"
)
end
desc "Deploy a new beta version to the Google Play"
lane :betaDeploy do
upload_to_play_store(
track: 'beta',
apk: "$HOME/apks_to_deploy/openhab-android.apk"
)
end
end
# More information about multiple platforms in fastlane: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
# All available actions: https://docs.fastlane.tools/actions
# fastlane reports which actions are used. No personal data is recorded.
# Learn more at https://docs.fastlane.tools/#metrics
#!/usr/bin/env bash
set -e
if $(echo "$TRAVIS_TAG" | grep -q "fdroid")
then
echo "Tag for F-Droid detected. Nothing to do"
exit 1
fi
manifest="mobile/src/main/AndroidManifest.xml"
currentVersionCode=$(grep 'android:versionCode' $manifest | sed -r 's/(.*)"(.*)"/\2/')
let currentVersionCode++
if [ -z "$TRAVIS_TAG" ]
then
TRAVIS_TAG=$(git rev-parse HEAD)
echo "Tag is empty, use git hash ($TRAVIS_TAG) instead"
fi
if [ -z "$currentVersionCode" ] || [ -z "$TRAVIS_TAG" ]
then
echo "Code ($currentVersionCode) or tag ($TRAVIS_TAG) are empty! Don't bump anything."
else
echo "New version code is $currentVersionCode and name $TRAVIS_TAG"
echo "Replace versionCode"
sed --in-place -r "s/android:versionCode=\"(.*)\"/android:versionCode=\"${currentVersionCode}\"/" $manifest
echo "Replace versionName"
sed --in-place -r "s/android:versionName=\"(.*)\"/android:versionName=\"${TRAVIS_TAG}\"/" $manifest
fi
#!/usr/bin/env bash
set -e
manifest="mobile/src/main/AndroidManifest.xml"
echo "Configure git"
git config --local user.name "TravisCI"
git config --local user.email "support@openhab.org"
echo "Git add"
git add fastlane/*
git add $manifest
echo "Git commit"
git commit -m "Bump version to $TRAVIS_TAG and update fastlane metadata"
echo "Git tag"
git tag -a "${TRAVIS_TAG}-fdroid" -m "${TRAVIS_TAG} for F-Droid"
echo "Git decrypt key"
openssl aes-256-cbc -K $encrypted_c0c05d762590_key -iv $encrypted_c0c05d762590_iv -in travis/key.enc -out travis/key -d > /dev/null 2>&1
echo "Copy ssh config"
cp travis/ssh-config ~/.ssh/config
echo "Git add remote"
git remote add github git@github.com:openhab/openhab-android
echo "Git fetch"
git fetch github
echo "Git push"
git push --quiet --set-upstream github :refs/heads/master > /dev/null 2>&1
File added
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDGmbjX/U2Li5YdL9smiRif3LNs/PKVuobAZS7Zva0FuApZggVx/V+cvBDyJDJAjw33WHCp/gQ0FeMrYvpZltzwJh/8HcahuBXbp5JEMMZVYdg1vIjMJ4QuIiF512SPJLq974FB4VCcbWgSpnGiMnH/MtX4ETFkYsOz0d2jEgZDH/vl7inMrym/GNJoN7p/UON6aE03RcRbpLIjgxtUQLE1S33pNkUvJQY9bTcbeCxobGR/iSSThEoOJv6hZtF153UBoZIuK5SQFJvBz3DcQi7WAGQyZOa83Drz4iq6OcoO7V6gSxszMbSdeJfaaAw19jD/P2mS0I6MI3k+1sC5cwOJHrpTNbmsXLNn8N3OFDSPagxxLQn1zVTELHp+HvN4zMgLnskEZMavETAmizfYEvmCVKh+/sykf2L40z9ZyimUPVEvgJl4/MYeIjeYnMfwc0xC8txppSI3qkU9ljfe5j9L9nFzYtvE34T9pL3Dd4TuIN3hW0WLnuRHBb4yxaPk/xfCdhLhJI5xqKTE5Y6fXT41g1F+eAqHrd3NrySnkvzJJPmBpYJBj3dEX7rOXnZxw/5NG9cklRVPbS/mQ1zqoLrH6AeI5IcN0FZk8N3uoEpjZglgrtRGhos5OA4Bno5vjxNvVadHbmY6UBCNMIqpP3/nbfS2mMl50CK//jDiaH/++Q== travis
Host github.com
HostName github.com
IdentityFile /home/travis/build/openhab/openhab-android/travis/key
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment