Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/pre-post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ on:
description: 'pull-request body'
type: string
required: true
changelog:
description: 'The changelog to prepend to CHANGELOG.md without heading'
type: string
required: false
default: ''

env:
RELEASE_VERSION: ${{ inputs.version }}
Expand Down Expand Up @@ -97,6 +102,19 @@ jobs:
uses: ./.github/workflows/gradle-goal
with:
command: ./gradlew -q setNextVersion

- name: Insert notes into cumulative changelog (post release)
if: inputs.phase == 'post'
run: |
echo "# ${{ inputs.version }} - $(date +'%d/%m/%Y')" > tmpchangelog
echo '${{ inputs.changelog }}' >> tmpchangelog
cat CHANGELOG.md >> tmpchangelog
mv tmpchangelog CHANGELOG.md

- name: Clear next release changelog (post release)
if: inputs.phase == 'post'
run: |
echo '' > CHANGELOG.next-release.md

- name: Push the ${{ inputs.phase }} release branch
run: |
Expand Down
28 changes: 27 additions & 1 deletion .github/workflows/release-step-3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,35 @@ jobs:
group-id: 'co.elastic.otel'
artifact-id: 'elastic-otel-javaagent'
version: ${{ inputs.version }}

generate-release-notes:
runs-on: ubuntu-latest
name: Generate the changelog for this release
outputs:
notes: ${{ steps.print_release_notes.outputs.notes }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Setup Gradle
uses: ./.github/workflows/gradle-goal
with:
command: ""
- name: Print Release Notes
id: print_release_notes
run: |
echo 'notes<<RELNOTESEOF' >> $GITHUB_OUTPUT
cat CHANGELOG.next-release.md >> $GITHUB_OUTPUT
printf '\nThis release is based on the following upstream versions:\n\n' >> $GITHUB_OUTPUT
./gradlew -q printUpstreamDependenciesMarkdown >> $GITHUB_OUTPUT
echo 'RELNOTESEOF' >> $GITHUB_OUTPUT
Comment on lines +220 to +224
Copy link
Member

Choose a reason for hiding this comment

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

[minor] could it be simpler to implement this completely as a gradle task ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it would be really simpler because then the gradle task would have to do the file handling, which is more code than cat CHANGELOG.next-release.md.
The multiline support code echo 'notes<<RELNOTESEOF' >> $GITHUB_OUTPUT and echo 'RELNOTESEOF' >> $GITHUB_OUTPUT would still be required, so we wouldn't save much



post-release:
name: "Bump versions and create PR"
needs:
- await-maven-central-artifact
- generate-release-notes
uses: ./.github/workflows/pre-post-release.yml
permissions:
contents: write
Expand All @@ -215,12 +239,14 @@ jobs:
phase: 'post'
pr_title: "[release] release-step-4 ${{ inputs.version }}"
pr_body: "Step 4 of the release process for version ${{ inputs.version }}: review & merge"
changelog: ${{needs.generate-release-notes.outputs.notes}}
secrets: inherit

create-github-release:
name: "Create GitHub Release"
needs:
- post-release
- generate-release-notes
runs-on: ubuntu-latest
if: ${{ ! inputs.dry_run }}
permissions:
Expand All @@ -236,4 +262,4 @@ jobs:
gh release create ${{ env.RELEASE_VERSION_TAG }} \
--verify-tag \
--title="Release ${{ env.RELEASE_VERSION }}" \
--notes=""
--notes='${{needs.generate-release-notes.outputs.notes}}'
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# 1.0.0
GA Release
1 change: 1 addition & 0 deletions CHANGELOG.next-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Fixed missing transitive dependencies when using universal profiling integration standalone - #423
40 changes: 37 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import java.io.FileInputStream
import java.nio.file.Paths
import java.nio.file.Files
import java.nio.file.StandardCopyOption

plugins {
alias(catalog.plugins.nexusPublish)
Expand All @@ -27,8 +24,45 @@ nexusPublishing {
}
}

repositories {
mavenCentral()
}

val printDependencyVersions: Configuration by configurations.creating
dependencies {
printDependencyVersions(platform(libs.opentelemetryInstrumentationAlphaBom))
printDependencyVersions("io.opentelemetry.javaagent:opentelemetry-javaagent")
printDependencyVersions("io.opentelemetry:opentelemetry-sdk")
}

tasks {

fun getResolvedDependency(identifier: String): ModuleComponentIdentifier? {
return printDependencyVersions.incoming.resolutionResult.allComponents.mapNotNull {
val id = it.id
return@mapNotNull if (id is ModuleComponentIdentifier) id else null;
}.find {
it.moduleIdentifier.toString() == identifier
}
}

/**
* Used from within our release automation as part of the release note generation.
*/
register("printUpstreamDependenciesMarkdown") {
dependsOn(printDependencyVersions)
doLast {
val agentVer = getResolvedDependency("io.opentelemetry.javaagent:opentelemetry-javaagent")!!.version
val sdkVer = getResolvedDependency("io.opentelemetry:opentelemetry-sdk")!!.version
val semconvVer = libs.versions.opentelemetrySemconvAlpha.get().replace("-alpha", "")
val contribVer = libs.versions.opentelemetryContribAlpha.get().replace("-alpha", "")
println("* opentelemetry-javaagent: [$agentVer](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/tag/v$agentVer)")
println("* opentelemetry-sdk: [$sdkVer](https://github.com/open-telemetry/opentelemetry-java/releases/tag/v$sdkVer)")
println("* opentelemetry-semconv: [$semconvVer](https://github.com/open-telemetry/semantic-conventions-java/releases/tag/v$semconvVer)")
println("* opentelemetry-java-contrib: [$contribVer](https://github.com/open-telemetry/opentelemetry-java-contrib/releases/tag/v$contribVer)")
}
}

register("currentVersion") {
doLast {
println(project.version)
Expand Down