@@ -22,12 +22,20 @@ jobs:
2222 name : " Draft a new release"
2323 runs-on : ubuntu-latest
2424 steps :
25- - uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
25+ - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
26+ with :
27+ token : ${{ secrets.CREATE_PR_TOKEN }}
28+ fetch-depth : 0
2629 - name : Create release branch
27- run : git checkout -b release/${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }}
30+ env :
31+ MAJOR_VERSION : ${{ github.event.inputs.major_version }}
32+ MINOR_VERSION : ${{ github.event.inputs.minor_version }}
33+ PATCH_VERSION : ${{ github.event.inputs.patch_version }}
34+ RUN_NUMBER : ${{ github.run_number }}
35+ run : git checkout -b release/$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$RUN_NUMBER
2836
2937 - name : Update Version Number
30- uses : Afterlife-Guide/SemVer.Action@9102e863e95f47d9687e4bdd67efe81f8c0d1baf
38+ uses : Afterlife-Guide/SemVer.Action@288a02559813fbd67393b5bd001cd796f1665905
3139 with :
3240 path : semver.json
3341 major-version : ${{ github.event.inputs.major_version }}
@@ -36,36 +44,59 @@ jobs:
3644 build-version : ${{ github.run_number }}
3745
3846 - name : Update changelog
39- uses : baynezy/ChangeLogger.Action@3f2bcbe4fb234cdd1ba608c7384d6379568f43a0
47+ uses : baynezy/ChangeLogger.Action@f714b7a6bcb0610dedb551cdc16a5adc0a775972
4048 with :
4149 tag : ${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }}
4250
4351 - name : Update docker image tag version in action.yml
52+ env :
53+ MAJOR_VERSION : ${{ github.event.inputs.major_version }}
54+ MINOR_VERSION : ${{ github.event.inputs.minor_version }}
55+ PATCH_VERSION : ${{ github.event.inputs.patch_version }}
56+ RUN_NUMBER : ${{ github.run_number }}
4457 run : |
45- sed -i "s/image: 'docker:\/\/ghcr.io\/afterlife-guide\/semver.action:.*/image: 'docker:\/\/ghcr.io\/afterlife-guide\/semver.action:${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }} '/" action.yml
58+ sed -i "s/image: 'docker:\/\/ghcr.io\/afterlife-guide\/semver.action:.*/image: 'docker:\/\/ghcr.io\/afterlife-guide\/semver.action:$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$RUN_NUMBER '/" action.yml
4659
4760 - name : Commit changelog, manifest and action definition files
4861 id : make-commit
62+ env :
63+ MAJOR_VERSION : ${{ github.event.inputs.major_version }}
64+ MINOR_VERSION : ${{ github.event.inputs.minor_version }}
65+ PATCH_VERSION : ${{ github.event.inputs.patch_version }}
66+ RUN_NUMBER : ${{ github.run_number }}
4967 run : |
5068 git config --global user.name "GitHub Action Bot"
5169 git config --global user.email "[email protected] " 5270 git add CHANGELOG.md semver.json action.yml
53- git commit --message "Prepare release ${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }} "
71+ git commit --message "Prepare release $MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$RUN_NUMBER "
5472
5573 echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
5674
5775 - name : Push new branch
58- run : git push origin release/${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }}
76+ env :
77+ MAJOR_VERSION : ${{ github.event.inputs.major_version }}
78+ MINOR_VERSION : ${{ github.event.inputs.minor_version }}
79+ PATCH_VERSION : ${{ github.event.inputs.patch_version }}
80+ RUN_NUMBER : ${{ github.run_number }}
81+ run : git push origin release/$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$RUN_NUMBER
5982
6083 - name : Create pull request
6184 env :
6285 GH_TOKEN : ${{ secrets.CREATE_PR_TOKEN }}
86+ ACTOR : ${{ github.actor }}
87+ REPOSITORY : ${{ github.repository }}
88+ RUN_ID : ${{ github.run_id }}
89+ COMMIT_SHA : ${{ steps.make-commit.outputs.commit }}
90+ MAJOR_VERSION : ${{ github.event.inputs.major_version }}
91+ MINOR_VERSION : ${{ github.event.inputs.minor_version }}
92+ PATCH_VERSION : ${{ github.event.inputs.patch_version }}
93+ RUN_NUMBER : ${{ github.run_number }}
6394 run : |
64- echo -e "Hi @${{ github.actor }} !\n\nThis PR was created in response to a manual trigger of the release workflow here: https://github.com/${{ github.repository }} /actions/runs/${{ github.run_id }}. \nI've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }} .\n\nMerging this PR will create a GitHub release and upload any assets that are created as part of the release build." > msg.txt
95+ echo -e "Hi @$ACTOR !\n\nThis PR was created in response to a manual trigger of the release workflow here: https://github.com/$REPOSITORY /actions/runs/$RUN_ID. \nI've updated the changelog and bumped the versions in the manifest files in this commit: $COMMIT_SHA .\n\nMerging this PR will create a GitHub release and upload any assets that are created as part of the release build." > msg.txt
6596
6697 export msg=$(cat msg.txt) ; gh pr create \
67- --head release/${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }} \
98+ --head release/$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$RUN_NUMBER \
6899 --base master \
69- --title "Release version ${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }} " \
70- --reviewer ${{ github.actor }} \
100+ --title "Release version $MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.$RUN_NUMBER " \
101+ --reviewer $ACTOR \
71102 --body "$msg"
0 commit comments