Skip to content
Closed
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
19 changes: 18 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,27 @@ jobs:
fetch-depth: 0
- name: Check the tag
run: |
if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
if [[ ! "$TAG" =~ ^v([0-9]+\.[0-9]+)\.[0-9]+$ ]]; then
echo "Can only publish a release tag (vX.Y.Z), got: $TAG"
exit 1
fi
MINOR="${BASH_REMATCH[1]}"
BRANCH="release-$MINOR"
if ! git rev-parse --verify --quiet "origin/$BRANCH" > /dev/null; then
echo "Branch $BRANCH does not exist, so $TAG cannot be on it"
exit 1
fi
if ! git merge-base --is-ancestor HEAD "origin/$BRANCH"; then
echo "$TAG is not on $BRANCH"
exit 1
fi
# Release branches are cut from main, so the head of an older release
# branch can also be on $BRANCH. Check the driver version too.
DRIVER="$(cat DRIVER_VERSION)"
if [[ "$DRIVER" != "$MINOR."* ]]; then
echo "$TAG has driver $DRIVER, expected $MINOR.x"
exit 1
fi
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
Expand Down
Loading