Skip to content

Commit 476dba6

Browse files
committed
update pre and post release workflows
1 parent 8f7a410 commit 476dba6

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.github/workflows/post-release-version-bump.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
version:
77
description: 'Version number (e.g., 1.0.1)'
88
required: true
9+
is_patch:
10+
description: 'Is this a patch? (true or false)'
11+
required: true
12+
default: 'false'
913

1014
env:
1115
AWS_DEFAULT_REGION: us-east-1
@@ -109,6 +113,16 @@ jobs:
109113
VERSION="${{ github.event.inputs.version }}"
110114
npm install
111115
sed -i "s|\(/aws-observability/adot-autoinstrumentation-node:\)v[0-9]\+\.[0-9]\+\.[0-9]\+|\1v${{github.event.inputs.version}}|g" .github/workflows/daily-scan.yml
116+
117+
# for patch releases, avoid merge conflict by manually resolving CHANGELOG with main
118+
if [[ "${{ github.event.inputs.is_patch }}" == "true" ]]; then
119+
git fetch origin main
120+
git show origin/main:CHANGELOG.md | sed -n '/## Unreleased/,/^## v[0-9]/p' | sed '$d' | tail -n +2 | sed '/^$/d' > /tmp/unreleased_content.txt
121+
122+
# Insert the content right after the existing "## Unreleased" header
123+
sed -i '/## Unreleased/r /tmp/unreleased_content.txt' CHANGELOG.md
124+
fi
125+
112126
git add .
113127
git status
114128
git commit -m "Prepare main for next development cycle: Update version to $DEV_VERSION"

.github/workflows/pre-release-prepare.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ jobs:
102102
npm install
103103
git commit -am "Update version to ${VERSION}"
104104
git push origin "v${VERSION}_release"
105+
106+
- name: Update CHANGELOG for release
107+
run: |
108+
sed -i "s/## Unreleased/## Unreleased\n\n## v${VERSION} - $(date +%Y-%m-%d)/" CHANGELOG.md
109+
git add CHANGELOG.md
110+
git commit -m "Update CHANGELOG for version ${VERSION}"
111+
git push origin "v${VERSION}_release"
105112
106113
- name: Create pull request against the release branch
107114
env:

0 commit comments

Comments
 (0)