-
Notifications
You must be signed in to change notification settings - Fork 76
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
ci(snapshot): skip deploy if no snapshot version or release version #238
ci(snapshot): skip deploy if no snapshot version or release version #238
Conversation
.github/workflows/release.yml
Outdated
@@ -51,6 +51,15 @@ jobs: | |||
echo "Tag should match pom.xml project.version" | |||
exit 1 | |||
fi | |||
- uses: ./.github/workflows/maven-goal |
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.
Do we even need this here? Don't we check for exact equality with the provided end.RELEASE_VERSION
above?
Someone would need to actually provide 1.6.0-SNAPSHOT
here to accidentally release a snapshot?
Disclaimer: I'm a shell scripting noob
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.
Do we even need this here? Don't we check for exact equality with the provided
end.RELEASE_VERSION
above?
You are right!
Although I'm a bit confused about the reason for using the inputs.version
, IIUC, it should be the pre-release
workflow, the one bumping the version and the release
workflow, the one using the pom.xml
file, to do the release. Hence inputs.version
is not something we need at all, the buildkite
pipeline is not using it.
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.
Someone would need to actually provide 1.6.0-SNAPSHOT here to accidentally release a snapshot?
Or change the pom.xml version in a different and use a different inputs.ref
.
I think the validation is still valid and in fact, the checkout for the given ref is needed, I'll do the change now
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.
see a696105
@@ -40,6 +40,7 @@ jobs: | |||
- name: Checkout | |||
uses: actions/checkout@v4 | |||
with: | |||
ref: ${{ inputs.ref }} |
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.
Fail fast if the ref is not correct. Otherwise, it's required to wait for the Buildkite pipeline to run
@@ -51,6 +52,12 @@ jobs: | |||
echo "Tag should match pom.xml project.version" | |||
exit 1 | |||
fi | |||
- name: Validate version is a release version |
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.
Otherwise, the pom.xml
version is a snapshot.
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.
LGTM
What
Why
The release process has been changed to accommodate the branch protection, and hence, the main will contain a release version until the PR with the snapshot version is merged.
Therefore, the snapshot GitHub action will run when it should not!
In addition, let's avoid the corner case where the
pom.xml
file contains a SNAPSHOT version and theinputs.ref
points to that particular git reference.Test
### Issues
Caused by #226