-
Notifications
You must be signed in to change notification settings - Fork 41
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
Update cicd #80
Update cicd #80
Conversation
@@ -5,7 +5,7 @@ plugins { | |||
id("signing") | |||
} | |||
|
|||
val isARelease = project.hasProperty("release") && project.property("release") == "true" | |||
val isARelease = System.getenv("CI") != null |
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.
@@ -21,8 +21,7 @@ jobs: | |||
- name: run gradle check | |||
run: ./gradlew check | |||
- name: publish snapshot | |||
# final=false here means SNAPSHOT | |||
run: ./gradlew publishMavenPublicationToSonatypeRepository -Prelease=true -Pfinal=false | |||
run: ./gradlew publishToSonatype |
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.
@trask Regarding the differences between publishMavenPublicationToSonatypeRepository
and publishToSonatype
- The former is more specific, if you have different publications configured and you don't want to publish them all at once (which is the case in the Elastic repo) then you can be more specific and set the name of the publication (in this case maven) to publish, but if you are fine with publishing all the configured publications then you can just run publishToSonatype
which ends up running all the specific-publication tasks.
It was set to the specific task name mostly due to a copy/paste from what we do at Elastic, however, since there's only one publication configured in this project, then there's no need to be specific, so I've just made the changes 👍
@@ -33,7 +33,7 @@ jobs: | |||
distribution: temurin | |||
java-version: 17.0.6 | |||
- name: Build and publish artifacts | |||
run: ./gradlew publishMavenPublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository -Prelease=true -Pfinal=${{ inputs.release_type == 'final' && 'true' || 'false' }} | |||
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -Pfinal=${{ inputs.release_type == 'final' && 'true' || 'false' }} |
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.
There's just one flag (the final
one) that I couldn't find a replacement for in the other repos. It essentially tells whether a release version is snapshot or not. When this flag is false or not provided, the version gets -SNAPSHOT
appended before publishing the artifacts, otherwise the version remains untouched as defined in the gradle.properties
file.
Having this flag is handy for controlling what type of release we want to publish from within the Gradle script, I couldn't find where in the other repos is the logic that appends (or removes) "-SNAPSHOT" from the version, I'm guessing it might be done in a bash script? @trask @breedx-splk
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.
check out https://github.com/open-telemetry/opentelemetry-java-contrib/blob/main/version.gradle.kts
this involves setting up the whole branching release workflow that the other repos use
I think it's fine to stay with what you have here for now, and we can discuss sync'ing release workflows in the future
Related to #58