-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This was a nice idea but has caused several headaches, and the problem it solves is ultimately a fairly minor one.
- Loading branch information
Showing
3 changed files
with
80 additions
and
88 deletions.
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,36 @@ | ||
#!/bin/bash | ||
# See usage() for usage | ||
|
||
source "$(dirname -- "$0";)/rel-common.sh" | ||
|
||
# Helpers | ||
function usage() { | ||
echo "Usage: ./bump-version.sh crate1 crate2 crateN bump" | ||
echo " ./bump-version.sh read-fonts write-fonts patch" | ||
echo " ./bump-version.sh {read,write}-fonts patch" | ||
echo "bump is as defined by cargo release: major minor or patch" | ||
} | ||
|
||
# What is it you want us to do? | ||
if [ $# -eq 0 ]; then | ||
die_with_usage "No arguments provided, must specify crate(s)" | ||
fi | ||
|
||
# bump is the last argument, crate list is everythign else | ||
bump="${@:$#}" | ||
set -- "${@:1:$(($#-1))}" | ||
crates=("$@") | ||
|
||
# Validate | ||
[[ "$bump" =~ ^(major|minor|patch)$ ]] || die_with_usage "Invalid bump, must be major, minor, or patch" | ||
|
||
validate_crates "${crates[@]}" | ||
|
||
# Do the thing. We set errexit so step failure should break us out. | ||
for crate in "${crates[@]}" | ||
do | ||
cargo release version "${bump}" -p "${crate}" -x | ||
done | ||
|
||
echo "NEXT STEPS" | ||
echo "Commit these changes to a new branch, get it approved and merged, and switch to the up-to-date main." |
This file was deleted.
Oops, something went wrong.
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,44 @@ | ||
#!/bin/bash | ||
# See usage() for usage | ||
|
||
source "$(dirname -- "$0";)/rel-common.sh" | ||
|
||
# Helpers | ||
function usage() { | ||
echo "Usage:" | ||
echo " # release everything changed" | ||
echo " ./release.sh" | ||
echo | ||
echo " # release one crate" | ||
echo " ./release.sh write-fonts" | ||
echo | ||
echo "Typically you should be running this after bump-version.sh" | ||
} | ||
|
||
# What is it you want us to do? | ||
if [ $# -gt 1 ]; then | ||
die_with_usage "Specify 0 - meaning all - or 1 packages" | ||
fi | ||
crate_specifier="" | ||
if [ $# -eq 1 ]; then | ||
crates=("$@") | ||
validate_crates "${crates[@]}" | ||
crate_specifier="-p ${crates[0]}" | ||
fi | ||
|
||
# Do the thing. We set errexit so step failure should break us out. | ||
|
||
echo "Dry run..." | ||
cargo release publish ${crate_specifier} | ||
|
||
echo "Doing the thing; ${COLOR_RED}PRESS CTRL+C if anything looks suspicious${TEXT_RESET}" | ||
|
||
echo "Publish to crates.io" | ||
cargo release publish -x ${crate_specifier} # this prompts y/N | ||
echo "Generate tags" | ||
cargo release tag -x ${crate_specifier} # this prompts y/N | ||
echo "Pushing tag to github" | ||
git push --tags | ||
|
||
echo "NEXT STEPS" | ||
echo "You probably want to create a release on github" |