Skip to content

Commit

Permalink
Release process fixes (#4753)
Browse files Browse the repository at this point in the history
* Don't commit RC bumps to release branch

* Look up release PR a more robust way

* Add script for creating release branch
  • Loading branch information
AnOctopus committed May 26, 2022
1 parent c4bea5d commit f9cef45
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
17 changes: 7 additions & 10 deletions .circleci/config.yml
Expand Up @@ -316,6 +316,11 @@ jobs:
- run:
name: Set final versions for pre-release and update version
command: |
# Start at the latest existing RC for this version if one exists,
# so the following update will increment to the right RC version
export LATEST_MATCHING_RC=$(curl https://pypi.org/pypi/streamlit/json | jq ".releases | keys | map(select(contains(\"rc\"))) | map(select(contains(\"$DESIRED_VERSION\"))) | sort | .[-1]")
if [ $LATEST_MATCHING_RC ]; then python scripts/update_version.py $LATEST_MATCHING_RC; fi
export STREAMLIT_RELEASE_SEMVER=$(python scripts/get_prerelease_version.py $DESIRED_VERSION)
echo 'export STREAMLIT_RELEASE_SEMVER=$(python scripts/get_prerelease_version.py $DESIRED_VERSION)' >> $BASH_ENV
echo 'export STREAMLIT_RELEASE_VERSION=$(echo $STREAMLIT_RELEASE_SEMVER | sed s/\-rc\./rc/)' >> $BASH_ENV
Expand Down Expand Up @@ -345,14 +350,6 @@ jobs:
command: |
make distribute
- run:
name: Commit version updates
command: |
git config user.email "core+streamlitbot-github@streamlit.io"
git config user.name "Streamlit Bot"
git commit -am "Up version to $STREAMLIT_RELEASE_VERSION [skip ci]" && git push origin $CIRCLE_BRANCH || echo "No changes to commit"
- slack/status:
success_message: ":rocket: Release of RC version ${STREAMLIT_RELEASE_SEMVER} was successful!"
failure_message: ":blobonfire: Release of RC version ${STREAMLIT_RELEASE_SEMVER} failed"
Expand Down Expand Up @@ -382,8 +379,8 @@ jobs:
name: Look up the related GitHub PR number and branch name
command: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "export GH_PR_NUMBER=$(gh api repos/${GH_REPO}/commits/${CIRCLE_SHA1}/pulls | jq '.[0] | .number')" >> $BASH_ENV
echo "export GH_PR_BRANCH=$(gh api repos/${GH_REPO}/commits/${CIRCLE_SHA1}/pulls | jq '.[0] | .head.ref')" >> $BASH_ENV
echo "export GH_PR_NUMBER=$(gh api repos/${GH_REPO}/pulls | jq '[.[] | select(.head.label | contains(\"release/\"))] | .[0] | .number')" >> $BASH_ENV
echo "export GH_PR_BRANCH=$(gh api repos/${GH_REPO}/pulls | jq '[.[] | select(.head.label | contains(\"release/\"))] | .[0] | .head.ref')" >> $BASH_ENV
- run:
name: Ensure that version tag matches branch version
Expand Down
23 changes: 23 additions & 0 deletions scripts/create_release_branch.sh
@@ -0,0 +1,23 @@
#!/bin/sh
# Copyright 2018-2022 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -euo pipefail

VERSION=$1
VERSION_BRANCH="release/${VERSION}"

git switch --create "$VERSION_BRANCH"
python scripts/update_version.py "$VERSION"
git commit --all --message="Up version to ${VERSION}"
git push origin "$VERSION_BRANCH"

0 comments on commit f9cef45

Please sign in to comment.