Skip to content

Commit bdc7695

Browse files
ezhang6811jj22ee
andcommitted
Enhance Github release notes (#1238)
*Issue #, if available:* *Description of changes:* DO NOT MERGE until #1163 has been merged. Add CHANGELOG entries to Github release notes and use headers to separate new changes, upstream components, release artifacts, and Lambda layer ARNs. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: Jonathan Lee <[email protected]>
1 parent ca43a8a commit bdc7695

File tree

1 file changed

+39
-12
lines changed

1 file changed

+39
-12
lines changed

.github/workflows/release-build.yml

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ jobs:
7474
steps:
7575
- name: Set up regions matrix
7676
id: set-matrix
77+
env:
78+
AWS_REGIONS: ${{ github.event.inputs.aws_region }}
7779
run: |
78-
IFS=',' read -ra REGIONS <<< "${{ github.event.inputs.aws_region }}"
80+
IFS=',' read -ra REGIONS <<< "$AWS_REGIONS"
7981
MATRIX="["
8082
for region in "${REGIONS[@]}"; do
8183
trimmed_region=$(echo "$region" | xargs)
@@ -180,8 +182,10 @@ jobs:
180182
load: true
181183

182184
- name: Test docker image
185+
env:
186+
VERSION: ${{ github.event.inputs.version }}
183187
shell: bash
184-
run: .github/scripts/test-adot-javaagent-image.sh "${{ env.TEST_TAG }}" "${{ github.event.inputs.version }}"
188+
run: .github/scripts/test-adot-javaagent-image.sh "${{ env.TEST_TAG }}" "$VERSION"
185189

186190
- name: Build and push image
187191
uses: docker/build-push-action@v5
@@ -380,34 +384,57 @@ jobs:
380384
name: layer.zip
381385

382386
- name: Rename artifacts
387+
env:
388+
VERSION: ${{ github.event.inputs.version }}
383389
run: |
384-
cp "aws-opentelemetry-agent-${{ github.event.inputs.version }}.jar" ${{ env.ARTIFACT_NAME }}
390+
cp "aws-opentelemetry-agent-$VERSION.jar" ${{ env.ARTIFACT_NAME }}
385391
cp aws-opentelemetry-java-layer.zip layer.zip
386392
387393
# Publish to GitHub releases
388394
- name: Create GH release
389395
id: create_release
390396
env:
391397
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
398+
VERSION: ${{ github.event.inputs.version }}
392399
run: |
393400
# Extract versions from dependency files
394401
OTEL_INSTRUMENTATION_VERSION=$(grep "val otelVersion" dependencyManagement/build.gradle.kts | sed 's/.*= "\([^"]*\)".*/\1/')
395402
OTEL_CONTRIB_VERSION=$(grep "io.opentelemetry.contrib:opentelemetry-aws-xray" dependencyManagement/build.gradle.kts | sed 's/.*:\([^"]*\)".*/\1/')
396403
404+
# Extract CHANGELOG entries for this version
405+
CHANGELOG_ENTRIES=$(python3 -c "
406+
import re, os
407+
version = os.environ['VERSION']
408+
with open('CHANGELOG.md', 'r') as f:
409+
content = f.read()
410+
version_pattern = rf'## v{re.escape(version)}.*?\n(.*?)(?=\n## |\Z)'
411+
version_match = re.search(version_pattern, content, re.DOTALL)
412+
if version_match:
413+
entries = version_match.group(1).strip()
414+
if entries:
415+
print(entries)
416+
")
417+
397418
# Create release notes
398419
cat > release_notes.md << EOF
399-
This release contains updates of the following upstream components:
420+
$(if [ -n "$CHANGELOG_ENTRIES" ]; then echo "## What's Changed"; echo "$CHANGELOG_ENTRIES"; echo ""; fi)
400421
401-
OpenTelemetry Java Contrib - $OTEL_CONTRIB_VERSION
402-
Opentelemetry Instrumentation for Java - $OTEL_INSTRUMENTATION_VERSION
422+
## Upstream Components
403423
404-
This release also publishes to public ECR and Maven Central.
405-
* See ADOT Java auto-instrumentation Docker image v${{ github.event.inputs.version }} in our public ECR repository:
424+
- \`OpenTelemetry Java Contrib\` - $OTEL_CONTRIB_VERSION
425+
- \`Opentelemetry Instrumentation for Java\` - $OTEL_INSTRUMENTATION_VERSION
426+
427+
## Release Artifacts
428+
429+
This release publishes to public ECR and Maven Central.
430+
* See ADOT Java auto-instrumentation Docker image v$VERSION in our public ECR repository:
406431
https://gallery.ecr.aws/aws-observability/adot-autoinstrumentation-java
407-
* See version ${{ github.event.inputs.version }} in our Maven Central repository:
432+
* See version $VERSION in our Maven Central repository:
408433
https://central.sonatype.com/artifact/software.amazon.opentelemetry/aws-opentelemetry-agent
409434
410-
This release also includes the AWS OpenTelemetry Lambda Layer for Java version ${{ github.event.inputs.version }}-$(echo $GITHUB_SHA | cut -c1-7).
435+
## Lambda Layer
436+
437+
This release includes the AWS OpenTelemetry Lambda Layer for Java version $VERSION-$(echo $GITHUB_SHA | cut -c1-7).
411438
412439
Lambda Layer ARNs:
413440
${{ needs.generate-lambda-release-note.outputs.layer-note }}
@@ -417,10 +444,10 @@ jobs:
417444
shasum -a 256 layer.zip > layer.zip.sha256
418445
419446
gh release create --target "$GITHUB_REF_NAME" \
420-
--title "Release v${{ github.event.inputs.version }}" \
447+
--title "Release v$VERSION" \
421448
--notes-file release_notes.md \
422449
--draft \
423-
"v${{ github.event.inputs.version }}" \
450+
"v$VERSION" \
424451
${{ env.ARTIFACT_NAME }} \
425452
${{ env.ARTIFACT_NAME }}.sha256 \
426453
layer.zip \

0 commit comments

Comments
 (0)