Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/check_version_markers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash

set -o nounset
set -o pipefail
set -o errexit

set -x

TAG=${1:-}
if [ -n "$TAG" ]; then
# If the workflow checks out one commit, but is releasing another
git fetch origin tag "$TAG"
# Update our local state so the grep command below searches what we expect
git checkout "$TAG"
fi

grep_exit_code=0
# Exclude dot directories, specifically, this file so that we don't
# find the substring we're looking for in our own file.
# Exclude CONTRIBUTING.md, RELEASING.md because they document how to use these strings.
grep --exclude=CONTRIBUTING.md \
--exclude=RELEASING.md \
--exclude=release.py \
--exclude=release_test.py \
--exclude-dir=.* \
VERSION_NEXT_ -r || grep_exit_code=$?

if [[ $grep_exit_code -eq 0 ]]; then
echo
echo "Found VERSION_NEXT markers indicating version needs to be specified"
exit 1
fi
20 changes: 3 additions & 17 deletions .github/workflows/create_archive_and_notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,10 @@ if [ -z "$TAG" ]; then
fi
# If the workflow checks out one commit, but is releasing another
git fetch origin tag "$TAG"
# Update our local state so the grep command below searches what we expect
git checkout "$TAG"

# Exclude dot directories, specifically, this file so that we don't
# find the substring we're looking for in our own file.
# Exclude CONTRIBUTING.md, RELEASING.md because they document how to use these strings.
grep --exclude=CONTRIBUTING.md \
--exclude=RELEASING.md \
--exclude=release.py \
--exclude=release_test.py \
--exclude-dir=.* \
VERSION_NEXT_ -r || grep_exit_code=$?

if [[ $grep_exit_code -eq 0 ]]; then
echo
echo "Found VERSION_NEXT markers indicating version needs to be specified"
exit 1
fi
# Update our local state so that check_version_markers searches what we expect
git checkout "$TAG"
$(dirname $0)/check_version_markers.sh

# A prefix is added to better match the GitHub generated archives.
PREFIX="rules_python-${TAG}"
Expand Down