File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -o nounset
4+ set -o pipefail
5+ set -o errexit
6+
7+ set -x
8+
9+ TAG=${1:- }
10+ if [ -n " $TAG " ]; then
11+ # If the workflow checks out one commit, but is releasing another
12+ git fetch origin tag " $TAG "
13+ # Update our local state so the grep command below searches what we expect
14+ git checkout " $TAG "
15+ fi
16+
17+ grep_exit_code=0
18+ # Exclude dot directories, specifically, this file so that we don't
19+ # find the substring we're looking for in our own file.
20+ # Exclude CONTRIBUTING.md, RELEASING.md because they document how to use these strings.
21+ grep --exclude=CONTRIBUTING.md \
22+ --exclude=RELEASING.md \
23+ --exclude=release.py \
24+ --exclude=release_test.py \
25+ --exclude-dir=.* \
26+ VERSION_NEXT_ -r || grep_exit_code=$?
27+
28+ if [[ $grep_exit_code -eq 0 ]]; then
29+ echo
30+ echo " Found VERSION_NEXT markers indicating version needs to be specified"
31+ exit 1
32+ fi
Original file line number Diff line number Diff line change @@ -26,24 +26,10 @@ if [ -z "$TAG" ]; then
2626fi
2727# If the workflow checks out one commit, but is releasing another
2828git fetch origin tag " $TAG "
29- # Update our local state so the grep command below searches what we expect
30- git checkout " $TAG "
3129
32- # Exclude dot directories, specifically, this file so that we don't
33- # find the substring we're looking for in our own file.
34- # Exclude CONTRIBUTING.md, RELEASING.md because they document how to use these strings.
35- grep --exclude=CONTRIBUTING.md \
36- --exclude=RELEASING.md \
37- --exclude=release.py \
38- --exclude=release_test.py \
39- --exclude-dir=.* \
40- VERSION_NEXT_ -r || grep_exit_code=$?
41-
42- if [[ $grep_exit_code -eq 0 ]]; then
43- echo
44- echo " Found VERSION_NEXT markers indicating version needs to be specified"
45- exit 1
46- fi
30+ # Update our local state so that check_version_markers searches what we expect
31+ git checkout " $TAG "
32+ $( dirname $0 ) /check_version_markers.sh
4733
4834# A prefix is added to better match the GitHub generated archives.
4935PREFIX=" rules_python-${TAG} "
You can’t perform that action at this time.
0 commit comments