Skip to content

Commit 7fea79c

Browse files
committed
Update POST RELESAE WORKFLOW
1 parent 3510ed5 commit 7fea79c

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

.github/workflows/post_release_version_bump.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
description: 'Version number (e.g., 1.0.1)'
88
required: true
99

10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
1014
jobs:
1115
prepare-main:
1216
runs-on: ubuntu-latest
@@ -21,27 +25,33 @@ jobs:
2125
git config user.name "github-actions"
2226
git config user.email "[email protected]"
2327
28+
- name: Extract Major.Minor Version and setup Env variable
29+
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+
2433
- name: Determine release branch and checkout
2534
run: |
26-
VERSION="${{ github.event.inputs.version }}"
27-
MAJOR_MINOR=$(echo $VERSION | awk -F. '{print $1"."$2}')
2835
RELEASE_BRANCH="release/${MAJOR_MINOR}.x"
2936
git fetch origin $RELEASE_BRANCH
3037
git checkout -b "prepare-main-for-next-dev-cycle-${VERSION}" origin/$RELEASE_BRANCH
3138
3239
- name: Update version to next development version in main
3340
run: |
3441
DEV_VERSION="${{ github.event.inputs.version }}.dev0"
35-
sed -i 's/__version__ = ".*"/__version__ = "'$DEV_VERSION'"/' aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py
42+
sed -i "s/__version__ = ".*"/__version__ = "'$DEV_VERSION'"/" aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py
3643
git add aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py
3744
git commit -m "Prepare main for next development cycle: Update version to $DEV_VERSION"
3845
git push --set-upstream origin "prepare-main-for-next-dev-cycle-${VERSION}"
3946
4047
- name: Create Pull Request to main
41-
uses: repo-sync/pull-request@v2
42-
with:
43-
source_branch: "prepare-main-for-next-dev-cycle-${VERSION}"
44-
destination_branch: 'main'
45-
github_token: ${{ secrets.GITHUB_TOKEN }}
46-
pr_title: "Prepare main for next development cycle: Update version to $DEV_VERSION"
47-
pr_body: "This PR prepares the main branch for the next development cycle by updating the version to $DEV_VERSION.\n\nBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice."
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
run: |
51+
DEV_VERSION="${{ github.event.inputs.version }}.dev0"
52+
gh pr create --title "Prepare main for next development cycle: Update version to $DEV_VERSION" \
53+
--body "This PR prepares the main branch for the next development cycle by updating the version to $DEV_VERSION.
54+
55+
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice." \
56+
--head prepare-main-for-next-dev-cycle-${VERSION} \
57+
--base main

.github/workflows/pre_release_prepare.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ jobs:
4646
4747
- name: Create pull request against the release branch
4848
env:
49-
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
5049
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5150
run: |
5251
gh pr create --title "Pre-release: Update version to ${VERSION}" \

0 commit comments

Comments
 (0)