Skip to content
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

Merged
merged 4 commits into from
Sep 18, 2023
Merged

Update cicd #80

merged 4 commits into from
Sep 18, 2023

Conversation

LikeTheSalad
Copy link
Contributor

Related to #58

@@ -5,7 +5,7 @@ plugins {
id("signing")
}

val isARelease = project.hasProperty("release") && project.property("release") == "true"
val isARelease = System.getenv("CI") != null
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trask I noticed that this env var check is what is being used in here to tell when the compilation is running in a GH action vs anywhere else, which is really cool and cleaner than having to pass a flag to the command, so we no longer need the release param 👍

@LikeTheSalad LikeTheSalad marked this pull request as ready for review September 14, 2023 09:20
@LikeTheSalad LikeTheSalad requested a review from a team September 14, 2023 09:20
@@ -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
Copy link
Contributor Author

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' }}
Copy link
Contributor Author

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

Copy link
Member

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

@LikeTheSalad LikeTheSalad merged commit e535df4 into open-telemetry:main Sep 18, 2023
1 check passed
@LikeTheSalad LikeTheSalad deleted the update-cicd branch September 18, 2023 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants