Skip to content

Commit

Permalink
chore: Migrate from Python to .NET for release progress reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
jskeet committed Sep 1, 2023
1 parent 5508b25 commit c18c78a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 533 deletions.
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"Google.Cloud.Tools.ReleaseProgressReporter": {
"version": "0.3.0",
"commands": [
"release-progress-reporter"
]
}
}
}
25 changes: 0 additions & 25 deletions .kokoro/README.md

This file was deleted.

26 changes: 4 additions & 22 deletions .kokoro/autorelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,13 @@ SCRIPT_DIR=$(dirname "$SCRIPT")

cd $SCRIPT_DIR

# Make sure secrets are loaded in a well known localtion before running releasetool
# Make sure secrets are loaded in a well known location before running
# the release reporter script.
source ./populatesecrets.sh
populate_all_secrets

# Make sure we have the most recent version of pip, then install other packages.
python -m pip install --require-hashes -r pip-requirements.txt
python -m pip install --require-hashes -r requirements.txt
python -m releasetool publish-reporter-script > /tmp/publisher-script

# The publish reporter script uses "python3" which doesn't exist on Windows.
# Work out what we should use instead.
# Try to detect Python 3. It's quite different between Windows and Linux.
if which python > /dev/null && python --version 2>&1 | grep -q "Python 3"; then declare -r PYTHON3=python
elif which py > /dev/null && py -3 --version 2>&1 | grep -q "Python 3"; then declare -r PYTHON3="py -3"
elif which python3 > /dev/null && python3 --version 2>&1 | grep -q "Python 3"; then declare -r PYTHON3=python3
else
echo "Unable to detect Python 3 installation."
exit 1
fi

# Fix up the publish reporter script using $PYTHON3. We assume this won't
# be harmful within sed - at the moment it's always "python", "py -3" or "python3".
sed -i "s/python3/$PYTHON3/g" /tmp/publisher-script

source /tmp/publisher-script
dotnet tool restore
source <(dotnet release-progress-reporter publish-reporter-script)

# Secrets are already populated, let's not do that again
./release.sh --skippopulatesecrets
2 changes: 0 additions & 2 deletions .kokoro/pip-requirements.txt

This file was deleted.

Loading

0 comments on commit c18c78a

Please sign in to comment.