-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
run the tag and release manually (#6)
- Loading branch information
1 parent
81f9384
commit 3a57125
Showing
2 changed files
with
31 additions
and
1 deletion.
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,30 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
curl -sL https://git.io/autotag-install | sh -- | ||
|
||
# fetch all tags and history: | ||
git fetch --tags --unshallow --prune | ||
|
||
if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then | ||
git branch --track main origin/main | ||
fi | ||
|
||
NEW_RELEASE=$(./bin/autotag) | ||
git push --tags | ||
gh release create "v${NEW_RELEASE}" -t "v${NEW_RELEASE}" --generate-notes | ||
|
||
# Extract the major version number | ||
MAJOR_VERSION=$(echo "${NEW_RELEASE}" | cut -d'.' -f1) | ||
|
||
echo "Major version: ${MAJOR_VERSION}" | ||
|
||
MAJOR_VERSION_BRANCH="v${MAJOR_VERSION}" | ||
if git show-ref --verify --quiet "refs/heads/${MAJOR_VERSION_BRANCH}"; then | ||
git checkout "${MAJOR_VERSION_BRANCH}" | ||
git merge --ff-only main | ||
else | ||
git checkout -b "${MAJOR_VERSION_BRANCH}" | ||
fi | ||
|
||
git push origin "${MAJOR_VERSION_BRANCH}" |
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