Skip to content

Commit

Permalink
run the tag and release manually (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence authored Aug 4, 2023
1 parent 81f9384 commit 3a57125
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .bin/tag-release.sh
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}"
2 changes: 1 addition & 1 deletion .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
- name: Checkout
uses: actions/checkout @v3
- name: Tag & Release
uses: pantheon-systems/action-autotag@main
run: bash ./bin/tag-release.sh
with:
gh-token: ${{ github.token }}

0 comments on commit 3a57125

Please sign in to comment.