Skip to content

Commit 77e1145

Browse files
ezhang6811jj22ee
andauthored
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 9e4f05c commit 77e1145

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
@@ -92,8 +92,10 @@ jobs:
9292
steps:
9393
- name: Set up regions matrix
9494
id: set-matrix
95+
env:
96+
AWS_REGIONS: ${{ github.event.inputs.aws_region }}
9597
run: |
96-
IFS=',' read -ra REGIONS <<< "${{ github.event.inputs.aws_region }}"
98+
IFS=',' read -ra REGIONS <<< "$AWS_REGIONS"
9799
MATRIX="["
98100
for region in "${REGIONS[@]}"; do
99101
trimmed_region=$(echo "$region" | xargs)
@@ -198,8 +200,10 @@ jobs:
198200
load: true
199201

200202
- name: Test docker image
203+
env:
204+
VERSION: ${{ github.event.inputs.version }}
201205
shell: bash
202-
run: .github/scripts/test-adot-javaagent-image.sh "${{ env.TEST_TAG }}" "${{ github.event.inputs.version }}"
206+
run: .github/scripts/test-adot-javaagent-image.sh "${{ env.TEST_TAG }}" "$VERSION"
203207

204208
- name: Build and push image
205209
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 #v6.18.0
@@ -398,34 +402,57 @@ jobs:
398402
name: layer.zip
399403

400404
- name: Rename artifacts
405+
env:
406+
VERSION: ${{ github.event.inputs.version }}
401407
run: |
402-
cp "aws-opentelemetry-agent-${{ github.event.inputs.version }}.jar" ${{ env.ARTIFACT_NAME }}
408+
cp "aws-opentelemetry-agent-$VERSION.jar" ${{ env.ARTIFACT_NAME }}
403409
cp aws-opentelemetry-java-layer.zip layer.zip
404410
405411
# Publish to GitHub releases
406412
- name: Create GH release
407413
id: create_release
408414
env:
409415
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
416+
VERSION: ${{ github.event.inputs.version }}
410417
run: |
411418
# Extract versions from dependency files
412419
OTEL_INSTRUMENTATION_VERSION=$(grep "val otelVersion" dependencyManagement/build.gradle.kts | sed 's/.*= "\([^"]*\)".*/\1/')
413420
OTEL_CONTRIB_VERSION=$(grep "io.opentelemetry.contrib:opentelemetry-aws-xray" dependencyManagement/build.gradle.kts | sed 's/.*:\([^"]*\)".*/\1/')
414421
422+
# Extract CHANGELOG entries for this version
423+
CHANGELOG_ENTRIES=$(python3 -c "
424+
import re, os
425+
version = os.environ['VERSION']
426+
with open('CHANGELOG.md', 'r') as f:
427+
content = f.read()
428+
version_pattern = rf'## v{re.escape(version)}.*?\n(.*?)(?=\n## |\Z)'
429+
version_match = re.search(version_pattern, content, re.DOTALL)
430+
if version_match:
431+
entries = version_match.group(1).strip()
432+
if entries:
433+
print(entries)
434+
")
435+
415436
# Create release notes
416437
cat > release_notes.md << EOF
417-
This release contains updates of the following upstream components:
438+
$(if [ -n "$CHANGELOG_ENTRIES" ]; then echo "## What's Changed"; echo "$CHANGELOG_ENTRIES"; echo ""; fi)
418439
419-
OpenTelemetry Java Contrib - $OTEL_CONTRIB_VERSION
420-
Opentelemetry Instrumentation for Java - $OTEL_INSTRUMENTATION_VERSION
440+
## Upstream Components
421441
422-
This release also publishes to public ECR and Maven Central.
423-
* See ADOT Java auto-instrumentation Docker image v${{ github.event.inputs.version }} in our public ECR repository:
442+
- \`OpenTelemetry Java Contrib\` - $OTEL_CONTRIB_VERSION
443+
- \`Opentelemetry Instrumentation for Java\` - $OTEL_INSTRUMENTATION_VERSION
444+
445+
## Release Artifacts
446+
447+
This release publishes to public ECR and Maven Central.
448+
* See ADOT Java auto-instrumentation Docker image v$VERSION in our public ECR repository:
424449
https://gallery.ecr.aws/aws-observability/adot-autoinstrumentation-java
425-
* See version ${{ github.event.inputs.version }} in our Maven Central repository:
450+
* See version $VERSION in our Maven Central repository:
426451
https://central.sonatype.com/artifact/software.amazon.opentelemetry/aws-opentelemetry-agent
427452
428-
This release also includes the AWS OpenTelemetry Lambda Layer for Java version ${{ github.event.inputs.version }}-$(echo $GITHUB_SHA | cut -c1-7).
453+
## Lambda Layer
454+
455+
This release includes the AWS OpenTelemetry Lambda Layer for Java version $VERSION-$(echo $GITHUB_SHA | cut -c1-7).
429456
430457
Lambda Layer ARNs:
431458
${{ needs.generate-lambda-release-note.outputs.layer-note }}
@@ -435,10 +462,10 @@ jobs:
435462
shasum -a 256 layer.zip > layer.zip.sha256
436463
437464
gh release create --target "$GITHUB_REF_NAME" \
438-
--title "Release v${{ github.event.inputs.version }}" \
465+
--title "Release v$VERSION" \
439466
--notes-file release_notes.md \
440467
--draft \
441-
"v${{ github.event.inputs.version }}" \
468+
"v$VERSION" \
442469
${{ env.ARTIFACT_NAME }} \
443470
${{ env.ARTIFACT_NAME }}.sha256 \
444471
layer.zip \

0 commit comments

Comments
 (0)