8181 steps :
8282 - name : Set up regions matrix
8383 id : set-matrix
84+ env :
85+ AWS_REGIONS : ${{ github.event.inputs.aws_region }}
8486 run : |
85- IFS=',' read -ra REGIONS <<< "${{ github.event.inputs.aws_region }} "
87+ IFS=',' read -ra REGIONS <<< "$AWS_REGIONS "
8688 MATRIX="["
8789 for region in "${REGIONS[@]}"; do
8890 trimmed_region=$(echo "$region" | xargs)
@@ -375,39 +377,60 @@ jobs:
375377 id : create_release
376378 env :
377379 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
380+ VERSION : ${{ github.event.inputs.version }}
378381 run : |
379382 # Extract all dependencies from pyproject.toml
380383 DEPS=$(python3 -c "
381- import re
382- with open('aws-opentelemetry-distro/pyproject.toml', 'r') as f:
383- content = f.read()
384- deps_match = re.search(r'dependencies\s*=\s*\[(.*?)\]', content, re.DOTALL)
385- if deps_match:
386- deps_content = deps_match.group(1)
387- dep_lines = re.findall(r'\"([^\"]+)\"', deps_content)
388- formatted_deps = []
389- for dep_line in dep_lines:
390- if ' == ' in dep_line:
391- package, version = dep_line.split(' == ', 1)
392- formatted_deps.append(f'- \`{package}\` - {version}')
393- else:
394- formatted_deps.append(f'- \`{dep_line}\`')
395- print('\n'.join(formatted_deps))
384+ import re
385+ with open('aws-opentelemetry-distro/pyproject.toml', 'r') as f:
386+ content = f.read()
387+ deps_match = re.search(r'dependencies\s*=\s*\[(.*?)\]', content, re.DOTALL)
388+ if deps_match:
389+ deps_content = deps_match.group(1)
390+ dep_lines = re.findall(r'\"([^\"]+)\"', deps_content)
391+ formatted_deps = []
392+ for dep_line in dep_lines:
393+ if ' == ' in dep_line:
394+ package, version = dep_line.split(' == ', 1)
395+ formatted_deps.append(f'- \`{package}\` - {version}')
396+ else:
397+ formatted_deps.append(f'- \`{dep_line}\`')
398+ print('\n'.join(formatted_deps))
399+ ")
400+
401+ # Extract CHANGELOG entries for this version
402+ CHANGELOG_ENTRIES=$(python3 -c "
403+ import re, os
404+ version = os.environ['VERSION']
405+ with open('CHANGELOG.md', 'r') as f:
406+ content = f.read()
407+ version_pattern = rf'## v{re.escape(version)}.*?\n(.*?)(?=\n## |\Z)'
408+ version_match = re.search(version_pattern, content, re.DOTALL)
409+ if version_match:
410+ entries = version_match.group(1).strip()
411+ if entries:
412+ print(entries)
396413 ")
397414
398415 # Create release notes
399416 cat > release_notes.md << EOF
400- This release contains the following upstream components:
417+ $(if [ -n "$CHANGELOG_ENTRIES" ]; then echo "## What's Changed"; echo "$CHANGELOG_ENTRIES"; echo ""; fi)
418+
419+ ## Upstream Components
401420
402421 $DEPS
403422
404- This release also publishes to public ECR and PyPi.
405- * See ADOT Python auto-instrumentation Docker image v${{ github.event.inputs.version }} in our public ECR repository:
423+ ## Release Artifacts
424+
425+ This release publishes to public ECR and PyPi.
426+ * See ADOT Python auto-instrumentation Docker image v$VERSION in our public ECR repository:
406427 https://gallery.ecr.aws/aws-observability/adot-autoinstrumentation-python
407- * See version ${{ github.event.inputs.version }} in our PyPi repository:
428+ * See version $VERSION in our PyPi repository:
408429 https://pypi.org/project/aws-opentelemetry-distro/
409430
410- This release also includes the AWS OpenTelemetry Lambda Layer for Python version ${{ github.event.inputs.version }}-$(echo $GITHUB_SHA | cut -c1-7).
431+ ## Lambda Layer
432+
433+ This release includes the AWS OpenTelemetry Lambda Layer for Python version $VERSION-$(echo $GITHUB_SHA | cut -c1-7).
411434
412435 Lambda Layer ARNs:
413436 ${{ needs.generate-lambda-release-note.outputs.layer-note }}
@@ -417,10 +440,10 @@ jobs:
417440 shasum -a 256 layer.zip > layer.zip.sha256
418441
419442 gh release create --target "$GITHUB_REF_NAME" \
420- --title "Release v${{ github.event.inputs.version }} " \
443+ --title "Release v$VERSION " \
421444 --notes-file release_notes.md \
422445 --draft \
423- "v${{ github.event.inputs.version }} " \
446+ "v$VERSION " \
424447 ${{ env.ARTIFACT_NAME }} \
425448 ${{ env.ARTIFACT_NAME }}.sha256 \
426449 layer.zip \
0 commit comments