-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3510ed5
commit 7fea79c
Showing
2 changed files
with
20 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,10 @@ on: | |
description: 'Version number (e.g., 1.0.1)' | ||
required: true | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
prepare-main: | ||
runs-on: ubuntu-latest | ||
|
@@ -21,27 +25,33 @@ jobs: | |
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
- name: Extract Major.Minor Version and setup Env variable | ||
run: | | ||
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV | ||
echo "MAJOR_MINOR=$(echo ${{ github.event.inputs.version }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV | ||
- name: Determine release branch and checkout | ||
run: | | ||
VERSION="${{ github.event.inputs.version }}" | ||
MAJOR_MINOR=$(echo $VERSION | awk -F. '{print $1"."$2}') | ||
RELEASE_BRANCH="release/${MAJOR_MINOR}.x" | ||
git fetch origin $RELEASE_BRANCH | ||
git checkout -b "prepare-main-for-next-dev-cycle-${VERSION}" origin/$RELEASE_BRANCH | ||
- name: Update version to next development version in main | ||
run: | | ||
DEV_VERSION="${{ github.event.inputs.version }}.dev0" | ||
sed -i 's/__version__ = ".*"/__version__ = "'$DEV_VERSION'"/' aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py | ||
sed -i "s/__version__ = ".*"/__version__ = "'$DEV_VERSION'"/" aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py | ||
git add aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py | ||
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}" | ||
- name: Create Pull Request to main | ||
uses: repo-sync/pull-request@v2 | ||
with: | ||
source_branch: "prepare-main-for-next-dev-cycle-${VERSION}" | ||
destination_branch: 'main' | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
pr_title: "Prepare main for next development cycle: Update version to $DEV_VERSION" | ||
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." | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
DEV_VERSION="${{ github.event.inputs.version }}.dev0" | ||
gh pr create --title "Prepare main for next development cycle: Update version to $DEV_VERSION" \ | ||
--body "This PR prepares the main branch for the next development cycle by updating the version to $DEV_VERSION. | ||
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice." \ | ||
--head prepare-main-for-next-dev-cycle-${VERSION} \ | ||
--base main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters