Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release process fixes #4753

Merged
merged 7 commits into from May 23, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 6 additions & 10 deletions .circleci/config.yml
Expand Up @@ -316,6 +316,10 @@ 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
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
AnOctopus marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -345,14 +349,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 +378,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"