-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
25 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,10 +42,18 @@ jobs: | |
git config user.name 'githooks-bot' | ||
git config user.email '[email protected]' | ||
[ "$(git cat-file -t "$TRIGGER_TAG")" = "tag" ] || { | ||
echo "Tag '$TRIGGER_TAG' is not an annotated tag." | ||
git cat-file -t "$TRIGGER_TAG" | ||
git --version | ||
exit 1 | ||
} | ||
# Gets the message on the annotated commit: | ||
deref() { git for-each-ref "refs/tags/$TRIGGER_TAG" --format="%($1)" ; }; | ||
# Creates a new tag with the same message, including trailing headers. | ||
git tag "$RELEASE_TAG" -a -m "$(deref contents)" | ||
git tag -a -m "$(deref contents)" "$RELEASE_TAG" | ||
git tag "githooks/$RELEASE_TAG" | ||
- name: Define Release Branch | ||
|
@@ -57,25 +65,35 @@ jobs: | |
RELEASE_BRANCH="main" | ||
RELEASE_VERSION="${RELEASE_TAG##v}" | ||
regex="^Release-Branch:\s+(.*)$" | ||
echo "Get release branch on tag '$RELEASE_TAG'." | ||
# Gets the message on the annotated commit: | ||
deref() { | ||
git for-each-ref "refs/tags/$RELEASE_TAG" --format="%($1)" ; | ||
}; | ||
git show -s --format="" $RELEASE_TAG | ||
deref contents | ||
regex="^Release-Branch:\s+(.*)$" | ||
if deref contents | grep -qE "$regex"; then | ||
RELEASE_BRANCH=$(deref contents | grep -E "$regex" | | ||
sed -E "s/$regex/\1/") || { | ||
echo "Release-Branch trailer is wrong." | ||
exit 1 | ||
} | ||
[ -n "$RELEASE_BRANCH" ] || { | ||
echo "Release-Branch trailer is empty." | ||
exit 1 | ||
} | ||
fi | ||
# Fetch the branch. | ||
git fetch --depth 50 origin "$RELEASE_BRANCH" | ||
# Check if its reachable. | ||
[ -n "$(git rev-list --first-parent \ | ||
--ancestry-path | ||
--ancestry-path \ | ||
"$RELEASE_TAG^..origin/$RELEASE_BRANCH")" ] || { | ||
echo "Tag is not reachable from '$RELEASE_BRANCH' (--first-parent) !" >&2 | ||
exit 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
{ "version": "3.0.0" } | ||
{ | ||
"version": "3.0.0-rc1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters