7
7
description : ' Version number (e.g., 1.0.1)'
8
8
required : true
9
9
10
+ permissions :
11
+ contents : write
12
+ pull-requests : write
13
+
10
14
jobs :
11
15
prepare-main :
12
16
runs-on : ubuntu-latest
@@ -21,27 +25,33 @@ jobs:
21
25
git config user.name "github-actions"
22
26
git config user.email "[email protected] "
23
27
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
+
24
33
- name : Determine release branch and checkout
25
34
run : |
26
- VERSION="${{ github.event.inputs.version }}"
27
- MAJOR_MINOR=$(echo $VERSION | awk -F. '{print $1"."$2}')
28
35
RELEASE_BRANCH="release/${MAJOR_MINOR}.x"
29
36
git fetch origin $RELEASE_BRANCH
30
37
git checkout -b "prepare-main-for-next-dev-cycle-${VERSION}" origin/$RELEASE_BRANCH
31
38
32
39
- name : Update version to next development version in main
33
40
run : |
34
41
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
36
43
git add aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py
37
44
git commit -m "Prepare main for next development cycle: Update version to $DEV_VERSION"
38
45
git push --set-upstream origin "prepare-main-for-next-dev-cycle-${VERSION}"
39
46
40
47
- 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\n By 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
0 commit comments