-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore/add automated release or update of major GHA version (#60)
* Initial commit * Use head * Automated update or releasing of major GHA versions * Give perms * Fetch depth * GH Token * Typo * Needs tag * Update name of step * Update .github/workflows/create-update-release.yaml Co-authored-by: Mitchell Nielsen <mitchnielsen@users.noreply.github.com> --------- Co-authored-by: Mitchell Nielsen <mitchnielsen@users.noreply.github.com>
- Loading branch information
1 parent
21e36b7
commit 1e88db2
Showing
2 changed files
with
35 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,32 @@ | ||
--- | ||
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 | ||
fi | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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