File tree Expand file tree Collapse file tree 3 files changed +34
-16
lines changed
Expand file tree Collapse file tree 3 files changed +34
-16
lines changed 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 @@ -29,22 +29,6 @@ git fetch origin tag "$TAG"
2929# Update our local state so the grep command below searches what we expect
3030git checkout " $TAG "
3131
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
47-
4832# A prefix is added to better match the GitHub generated archives.
4933PREFIX=" rules_python-${TAG} "
5034ARCHIVE=" rules_python-$TAG .tar.gz"
Original file line number Diff line number Diff line change 4343 uses : actions/checkout@v6
4444 with :
4545 ref : ${{ github.ref_name }}
46+ - name : Check version markers
47+ run : .github/workflows/check_version_markers.sh ${{ inputs.tag_name || github.ref_name }}
4648 - name : Create release archive and notes
4749 run : .github/workflows/create_archive_and_notes.sh ${{ inputs.tag_name || github.ref_name }}
4850 - name : Release
You can’t perform that action at this time.
0 commit comments