-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the script I have been using to tag and release prior versions.
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Date since the last release. We will search for commits newer than this. | ||
# TODO There is probably some Git magic we could do to figure this out | ||
SINCE=${SINCE:-2023-08-19} | ||
|
||
# The last version that was tagged. | ||
# TODO There is probably some Git magic we could do to figure this out | ||
LATEST=${LATEST:-5.7.6} | ||
|
||
# Search the git log for commits that did an Automatic version bump. | ||
git log --oneline --grep=Automatic --since=$SINCE | awk '{print $1,$NF}' | grep -v $LATEST | tail -r | while read -r line ; do | ||
commit=$(echo $line | awk '{print $1}') | ||
tag=v$(echo $line | awk '{print $2}') | ||
# Get the actual date the commit was made | ||
export GIT_COMMITTER_DATE=$(git show --format=%aD $commit | head -1) | ||
# Tag the commit | ||
echo "Tagging $commit as $tag $GIT_COMMITTER_DATE" | ||
git checkout $commit | ||
git tag -a -m "Automatic tagging of $tag" $tag | ||
git push origin $tag | ||
# Generate the release. | ||
gh release create $tag --generate-notes --latest | ||
done | ||
git checkout master | ||
echo "Done." |