New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pin Android Components version and add script for automated updates. #1050
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
# If a command fails then do not proceed and fail this script too. | ||
set -ex | ||
|
||
# Install dependencies (TODO: Move to Docker image) | ||
apt-get install -y brew | ||
brew install hub | ||
|
||
BRANCH="ac-update" | ||
USER="MickeyMoz" | ||
EMAIL="sebastian@mozilla.com" | ||
REPO="reference-browser" | ||
|
||
git config --global user.email $EMAIL | ||
git config --global user.name $USER | ||
|
||
# Fetching latest version | ||
LATEST_VERSION=`curl https://nightly.maven.mozilla.org/maven2/org/mozilla/components/browser-engine-gecko-nightly/maven-metadata.xml | sed -ne '/latest/{s/.*<latest>\(.*\)<\/latest>.*/\1/p;q;}'` | ||
|
||
# Updating version file | ||
sed -i "s/VERSION = \".*\"/VERSION = \"$LATEST_VERSION\"/g" "buildSrc/src/main/java/AndroidComponents.kt" | ||
|
||
# Create a branch and commit local changes | ||
git checkout -b $BRANCH | ||
git add buildSrc/src/main/java/AndroidComponents.kt | ||
git commit -m \ | ||
"Update Android Components version to $LATEST_VERSION." \ | ||
--author="MickeyMoz <sebastian@mozilla.com>" \ | ||
|| { echo "No new Android Components version ($LATEST_VERSTION) available"; exit 0; } | ||
|
||
# Get token for using GitHub | ||
python automation/taskcluster/helper/get-secret.py \ | ||
-s project/mobile/github \ | ||
-k botAccountToken \ | ||
-f .github_token \ | ||
|
||
# From here on we do not want to print the commands since they contain tokens | ||
set +x | ||
|
||
GITHUB_TOKEN=`cat .github_token` | ||
URL="https://$USER:$GITHUB_TOKEN@github.com/$USER/$REPO/" | ||
|
||
# Push changes to GitHub | ||
echo "Pushing branch to GitHub" | ||
git push -f --no-verify --quiet $URL $BRANCH > /dev/null 2>&1 || echo "Failed ($?)" | ||
|
||
# Open a PR if needed | ||
if [[ $(hub pr list -h $USER:$BRANCH) ]]; then | ||
echo "There's already an open PR." | ||
else | ||
echo "No PR found. Opening new PR." | ||
hub pull-request -b master -h MickeyMoz:ac-update --no-edit -m "Update Android Components version" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
object AndroidComponents { | ||
const val VERSION = "35.0.20200303130104" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:Should we open an issue to keep track of it? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍