Skip to content

Revert changes made to PR 57 (#63) #2

Revert changes made to PR 57 (#63)

Revert changes made to PR 57 (#63) #2

---
name: Update Major Version of Prefect Deploy Action
on:
push:
tags:
# Match the version format to not catch vx major releases
- 'v*.*.*'
permissions: {}
jobs:
update-create-major-version:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Release or Update Major Version
run: |
export MAJOR_VERSION=$(echo ${{ github.ref_name }} | cut -d '.' -f 1)
echo "Releasing major version ${MAJOR_VERSION}"
if git show-ref --tags --verify --quiet "refs/tags/${MAJOR_VERSION}"; then
echo "Tag ${MAJOR_VERSION} exists, bumping to match with the latest release"
git tag ${MAJOR_VERSION} -f
git push origin ${MAJOR_VERSION} -f
else
echo "Tag ${MAJOR_VERSION} does not exist. Creating a new tag and release."
export RELEASE_SHA=$(git rev-parse HEAD)
gh release create "${MAJOR_VERSION}" --title "${MAJOR_VERSION}" --generate-notes --target "${RELEASE_SHA}" --latest=false
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}