From 72f3c694e2cc76465bb0cc25c9dcf877c34d7fdf Mon Sep 17 00:00:00 2001 From: Phil Tyler Date: Thu, 31 Aug 2023 11:56:15 -0700 Subject: [PATCH] Switch to autotag action (#12) --- .github/workflows/tag-release.yml | 6 +++--- bin/tag-release.sh | 31 ------------------------------- 2 files changed, 3 insertions(+), 34 deletions(-) delete mode 100755 bin/tag-release.sh diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index ed1aa45..c285b6c 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -12,6 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - run: sh ./bin/tag-release.sh - env: - GH_TOKEN: ${{ github.token }} \ No newline at end of file + - uses: pantheon-systems/action-autotag@v0 + with: + gh-token: ${{ github.token }} \ No newline at end of file diff --git a/bin/tag-release.sh b/bin/tag-release.sh deleted file mode 100755 index 4540658..0000000 --- a/bin/tag-release.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -set -ex - -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 - # ensure a local 'main' branch exists at 'refs/heads/main' - 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}" \ No newline at end of file