99
1010env :
1111 AWS_DEFAULT_REGION : us-east-1
12+ VERSION_INPUT : ${{ env.VERSION_INPUT }}
13+ IS_PATCH_INPUT : ${{ github.event.inputs.is_patch }}
1214
1315permissions :
1416 id-token : write
2729
2830 - name : Extract Major.Minor Version and setup Env variable
2931 run : |
30- echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
31- echo "MAJOR_MINOR=$(echo ${{ github.event.inputs.version }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV
32+ echo "VERSION=${{ env.VERSION_INPUT }}" >> $GITHUB_ENV
33+ echo "MAJOR_MINOR=$(echo ${{ env.VERSION_INPUT }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV
3234
3335 - name : Get current major.minor version from main branch
3436 id : get_version
8486
8587 - name : Extract Major.Minor Version and setup Env variable
8688 run : |
87- echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
88- echo "MAJOR_MINOR=$(echo ${{ github.event.inputs.version }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV
89+ echo "VERSION=${{ env.VERSION_INPUT }}" >> $GITHUB_ENV
90+ echo "MAJOR_MINOR=$(echo ${{ env.VERSION_INPUT }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV
8991
9092 - name : Determine release branch and checkout
9193 run : |
@@ -96,10 +98,26 @@ jobs:
9698 - name : Update version to next development version in main
9799 # TODO update version in daily_scan.yml
98100 run : |
99- DEV_VERSION="${{ github.event.inputs.version }}.dev0"
101+ DEV_VERSION="${{ env.VERSION_INPUT }}.dev0"
100102 sed -i "s/public static string version = \".*\";/public static string version = \"${DEV_VERSION}\";/" src/AWS.Distro.OpenTelemetry.AutoInstrumentation/Version.cs
101103 sed -i "s/private readonly string version = \".*\";/private readonly string version = \"${DEV_VERSION}\";/" build/Build.InstallationScripts.cs
102- VERSION="${{ github.event.inputs.version }}"
104+ <<<<<<< HEAD:.github/workflows/post_release_version_bump.yml
105+ VERSION="${{ env.VERSION_INPUT }}"
106+ =======
107+ VERSION="${{ env.VERSION_INPUT }}"
108+ sed -i -e 's/dotnet:v.*"/dotnet:v'$VERSION'"/' .github/workflows/daily-scan.yml
109+
110+ # for patch releases, avoid merge conflict by manually resolving CHANGELOG with main
111+ if [[ "${{ env.IS_PATCH_INPUT }}" == "true" ]]; then
112+ # Copy the patch release entries
113+ sed -n "/^## v${VERSION}/,/^## v[0-9]/p" CHANGELOG.md | sed '$d' > /tmp/patch_release_section.txt
114+ git fetch origin main
115+ git show origin/main:CHANGELOG.md > CHANGELOG.md
116+ # Insert the patch release entries after Unreleased
117+ awk -i inplace '/^## v[0-9]/ && !inserted { system("cat /tmp/patch_release_section.txt"); inserted=1 } {print}' CHANGELOG.md
118+ fi
119+
120+ >>>>>>> 371c614 (fix: prevent script injection in workflows (#318)):.github/workflows/post-release-version-bump.yml
103121 git add src/AWS.Distro.OpenTelemetry.AutoInstrumentation/Version.cs
104122 git add build/Build.InstallationScripts.cs
105123 git commit -m "Prepare main for next development cycle : Update version to $DEV_VERSION"
@@ -109,7 +127,7 @@ jobs:
109127 env :
110128 GITHUB_TOKEN : ${{ env.BOT_TOKEN_GITHUB_RW_PATOKEN }}
111129 run : |
112- DEV_VERSION="${{ github.event.inputs.version }}.dev0"
130+ DEV_VERSION="${{ env.VERSION_INPUT }}.dev0"
113131 gh pr create --title "Post release $VERSION: Update version to $DEV_VERSION" \
114132 --body "This PR prepares the main branch for the next development cycle by updating the version to $DEV_VERSION and updating the image version to be scanned to the latest released.
115133
0 commit comments