Skip to content
39 changes: 31 additions & 8 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ jobs:
steps:
- name: Set up regions matrix
id: set-matrix
env:
AWS_REGIONS: ${{ github.event.inputs.aws_region }}
run: |
IFS=',' read -ra REGIONS <<< "${{ github.event.inputs.aws_region }}"
IFS=',' read -ra REGIONS <<< "$AWS_REGIONS"
MATRIX="["
for region in "${REGIONS[@]}"; do
trimmed_region=$(echo "$region" | xargs)
Expand Down Expand Up @@ -341,6 +343,7 @@ jobs:
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ github.event.inputs.version }}
run: |
# Generate dependency versions from package.json
DEPS=$(node -e "
Expand All @@ -351,19 +354,39 @@ jobs:
console.log(deps);
")

# Extract CHANGELOG entries for this version
CHANGELOG_ENTRIES=$(python3 -c "
import re, os
version = os.environ['VERSION']
with open('CHANGELOG.md', 'r') as f:
content = f.read()
version_pattern = rf'## v{re.escape(version)}.*?\n(.*?)(?=\n## |\Z)'
version_match = re.search(version_pattern, content, re.DOTALL)
if version_match:
entries = version_match.group(1).strip()
if entries:
print(entries)
")

# Create release notes
cat > release_notes.md << EOF
This release contains the following upstream components:
$(if [ -n "$CHANGELOG_ENTRIES" ]; then echo "## What's Changed"; echo "$CHANGELOG_ENTRIES"; echo ""; fi)

## Upstream Components

$DEPS

This release also publishes to public ECR and NPM.
* See ADOT node auto-instrumentation Docker image v${{ github.event.inputs.version }} in our public ECR repository:
## Release Artifacts

This release publishes to public ECR and NPM.
* See ADOT node auto-instrumentation Docker image v$VERSION in our public ECR repository:
https://gallery.ecr.aws/aws-observability/adot-autoinstrumentation-node
* See version ${{ github.event.inputs.version }} in our NPM repository:
* See version $VERSION in our NPM repository:
https://www.npmjs.com/package/@aws/aws-distro-opentelemetry-node-autoinstrumentation

This release also includes the AWS OpenTelemetry Lambda Layer for JavaScript version ${{ github.event.inputs.version }}-$(echo $GITHUB_SHA | cut -c1-7).
## Lambda Layer

This release includes the AWS OpenTelemetry Lambda Layer for JavaScript version $VERSION-$(echo $GITHUB_SHA | cut -c1-7).

Lambda Layer ARNs:
${{ needs.generate-lambda-release-note.outputs.layer-note }}
Expand All @@ -373,10 +396,10 @@ jobs:
shasum -a 256 layer.zip > layer.zip.sha256

gh release create --target "$GITHUB_REF_NAME" \
--title "Release v${{ github.event.inputs.version }}" \
--title "Release v$VERSION" \
--notes-file release_notes.md \
--draft \
"v${{ github.event.inputs.version }}" \
"v$VERSION" \
${{ env.ARTIFACT_NAME }} \
${{ env.ARTIFACT_NAME }}.sha256 \
layer.zip \
Expand Down