Skip to content

Commit

Permalink
[ci] Remove 'no println' check
Browse files Browse the repository at this point in the history
This was a nice idea but has caused several headaches, and the problem
it solves is ultimately a fairly minor one.
  • Loading branch information
cmyr committed Oct 25, 2023
1 parent dcd0839 commit 3aa931e
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 88 deletions.
36 changes: 36 additions & 0 deletions resources/scripts/bump-version.sh
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."
88 changes: 0 additions & 88 deletions resources/scripts/check_no_println.sh

This file was deleted.

44 changes: 44 additions & 0 deletions resources/scripts/release.sh
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"

0 comments on commit 3aa931e

Please sign in to comment.