-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore/add automated release or update of major GHA version #60
Changes from 9 commits
d00773b
289c6b0
cfc36b8
c6aa630
19649eb
31a230d
ec9d48e
7c87e4c
858aa19
8974f91
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 UpdateMajor Version | ||
jimid27 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this can be ref'd by $GITHUB_TOKEN but i could be wrong There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://github.com/elgohr/Github-Release-Action?tab=readme-ov-file#github-release-action I was going off of this referenced by the github actions docs and I think it works since I tested a major bump in my own repo but if theres a better way I'm def down to change! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Means we don't want to run this action when a major version (i.e v5) is tagged and released
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the
else
statement doing then if not running on a major release?