Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 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
15 changes: 15 additions & 0 deletions .github/workflows/post-release-version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
version:
description: 'Version number (e.g., 1.0.1)'
required: true
is_patch:
description: 'Is this a patch? (true or false)'
required: true
default: 'false'

env:
AWS_DEFAULT_REGION: us-east-1
Expand Down Expand Up @@ -100,8 +104,19 @@ jobs:
sed -i 's/__version__ = ".*"/__version__ = "'$DEV_VERSION'"/' aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py
VERSION="${{ github.event.inputs.version }}"
sed -i 's/python:v.*"/python:v'$VERSION'"/' .github/workflows/daily-scan.yml

# for patch releases, avoid merge conflict by manually resolving CHANGELOG with main
if [[ "${{ github.event.inputs.is_patch }}" == "true" ]]; then
git fetch origin main
git show origin/main:CHANGELOG.md | sed -n '/## Unreleased/,/^## v[0-9]/p' | sed '$d' | tail -n +2 | sed '/^$/d' > /tmp/unreleased_content.txt

# Insert the content right after the existing "## Unreleased" header
sed -i '/## Unreleased/r /tmp/unreleased_content.txt' CHANGELOG.md
fi

git add aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py
git add .github/workflows/daily-scan.yml
git add CHANGELOG.md
git commit -m "Prepare main for next development cycle: Update version to $DEV_VERSION"
git push --set-upstream origin "prepare-main-for-next-dev-cycle-${VERSION}"

Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,42 @@ permissions:
contents: read

jobs:
changelog-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check CHANGELOG
run: |
# Check if PR is from workflows bot or dependabot
if [[ "${{ github.event.pull_request.user.login }}" == "aws-application-signals-bot" ]]; then
echo "Skipping check: PR from aws-application-signals-bot"
exit 0
fi

if [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then
echo "Skipping check: PR from dependabot"
exit 0
fi

# Check for Skip Changelog label
if echo '${{ toJSON(github.event.pull_request.labels.*.name) }}' | jq -r '.[]' | grep -q "skip changelog"; then
echo "Skipping check: Skip Changelog label found"
exit 0
fi

# Fetch base branch and check for CHANGELOG modifications
git fetch origin ${{ github.base_ref }}
if git diff --name-only origin/${{ github.base_ref }}..HEAD | grep -q "CHANGELOG.md"; then
echo "CHANGELOG.md entry found - check passed"
exit 0
fi

echo "It looks like you didn't add an entry to CHANGELOG.md. If this change affects the SDK behavior, please update CHANGELOG.md and link this PR in your entry. If this PR does not need a CHANGELOG entry, you can add the 'Skip Changelog' label to this PR."
exit 1

build:
runs-on: ubuntu-latest
strategy:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/pre-release-prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ jobs:
git commit -am "Update version to ${VERSION}"
git push origin "v${VERSION}_release"

- name: Update CHANGELOG for release
run: |
sed -i "s/## Unreleased/## Unreleased\n\n## v${VERSION} - $(date +%Y-%m-%d)/" CHANGELOG.md
git add CHANGELOG.md
git commit -m "Update CHANGELOG for version ${VERSION}"
git push origin "v${VERSION}_release"

- name: Create pull request against the release branch
env:
GITHUB_TOKEN: ${{ env.BOT_TOKEN_GITHUB_RW_PATOKEN }}
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog

All notable changes to this project will be documented in this file.

> **Note:** This CHANGELOG was created starting from version 0.12.0. Earlier changes are not documented here.

For any change that affects end users of this package, please add an entry under the **Unreleased** section. Briefly summarize the change and provide the link to the PR. Example:
- add GenAI attribute support for Amazon Bedrock models
([#300](https://github.com/aws-observability/aws-otel-python-instrumentation/pull/300))

If your change does not need a CHANGELOG entry, add the "skip changelog" label to your PR.

## Unreleased