-
Notifications
You must be signed in to change notification settings - Fork 155
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
chore(release): add prep-release script #4473
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# This script's purpose is to check that any needed changes to the source | ||
# have been made prerelease. | ||
# | ||
# For example we check that all instances of 'introduced: NEXT' in the docs | ||
# have been replaced with a version instead. | ||
|
||
# Make sure we are at the repo root | ||
DIR=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)/.. | ||
cd $DIR | ||
|
||
EXIT=0 | ||
while read f | ||
do | ||
# Check for any introduced: NEXT comments that still exist | ||
grep "^//[[:space:]]*introduced:[[:space:]]\+NEXT[[:space:]]*$" $f > /dev/null | ||
ret=$? | ||
if [ $ret -eq 0 ] | ||
then | ||
EXIT=1 | ||
echo "$f contains 'introduced: NEXT'" | ||
fi | ||
done < <(find ./stdlib -name '*.flux') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow, this is quite the bash-ism. I had to read it a couple of times to realize what it did, and then spent a little more time trying to think of how I would implement it, and none of them are as efficient as this is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wanted to do it this way so that if we get spaces in file names it doesn't break. |
||
|
||
if [ $EXIT -ne 0 ] | ||
then | ||
echo "Flux not prepared for release. Run ./prep_release.sh to start the release preparation process." | ||
fi | ||
exit $EXIT |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# Make sure we are at the repo root | ||
DIR=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd) | ||
cd $DIR/.. | ||
|
||
# Version is the first and only arg, remove the 'v' prefix. | ||
version=${1//v/} | ||
|
||
while read f | ||
do | ||
# Replace any introduced: NEXT comment with the actual version | ||
sed -i "s/^\/\/[[:space:]]*introduced:[[:space:]]\+NEXT[[:space:]]*$/\/\/ introduced: $version/g" $f | ||
done < <(find ./stdlib -name '*.flux') |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "flux" | ||
version = "0.5.1" | ||
authors = ["jlapacik <[email protected]>"] | ||
version = "0.154.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to add a step to automatically bump the version in the Cargo file too. But the We can add that behavior of the release later. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, this is one of those things that has always bothered me. There are a couple of cargo tools that don't with workspaces that I use regularly. It makes me sad. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Submitted PR to cargo-bump for workspace support wraithan/cargo-bump#34 |
||
authors = ["Flux Team <[email protected]>"] | ||
edition = "2021" | ||
|
||
[lib] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
# Run this script to prepare a Flux release | ||
# | ||
# This script is responsible for creating a commit that finalizes any changes | ||
# to the source that need to be made before a release. | ||
# | ||
# The following optional dependencies are helpful if available. | ||
# | ||
# - `hub`, which will submit PRs for the update branches automatically if | ||
# available. | ||
|
||
DIR=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd) | ||
cd $DIR | ||
|
||
set -e | ||
|
||
version=$(./gotool.sh github.com/influxdata/changelog nextver) | ||
|
||
git checkout -b prep-release/$version | ||
|
||
./etc/fixup_docs_version.sh $version | ||
|
||
message="build(flux): prepare Flux release for $version" | ||
|
||
git commit -am "$message" | ||
|
||
if ! command -v hub &> /dev/null | ||
then | ||
echo "hub is not installed. Cannot open github PRs automatically." | ||
echo "Pull requests will have to be manually created." | ||
HAS_HUB=0 | ||
else | ||
HAS_HUB=1 | ||
fi | ||
|
||
if [ $HAS_HUB -eq 1 ] | ||
then | ||
hub pull-request -m "$message" -r influxdata/flux-team | ||
fi |
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.
@sanderson FYI we are looking to add this to our release process.