33 workflow_dispatch :
44 inputs :
55 targetRelease :
6- description : ' Release number to upgrade to. For example X.X.X'
6+ description : ' Release number to upgrade to. For example X.X.X. Follow Semantic Versioning when deciding on next version. '
77 required : true
8- previousRelease :
9- description : ' Current latest maven release'
10- required : false
118
129jobs :
1310 build :
1411 runs-on : ubuntu-latest
1512 steps :
1613 - uses : actions/checkout@v2
17- - name : Find and Replace ${{ github.event.inputs.previousRelease }} with ${{ github.event.inputs.targetRelease }}
14+ - name : Get current date
15+ id : date
16+ run : echo "::set-output name=date::$(date +'%Y-%m-%d')"
17+ - name : Set current release version env variable
18+ run : |
19+ echo "CURRENT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
20+ - name : Find and Replace ${{ env.CURRENT_VERSION }} with ${{ github.event.inputs.targetRelease }} in mkdocs.yml
1821 uses : jacobtomlinson/gha-find-replace@v2
1922 with :
20- find : ${{ github.event.inputs.previousRelease }}
23+ find : ' version: ${{ env.CURRENT_VERSION }}'
24+ replace : ' version: ${{ github.event.inputs.targetRelease }}'
25+ regex : false
26+ include : " mkdocs.yml"
27+ - name : Find and Replace ${{ env.CURRENT_VERSION }} with ${{ github.event.inputs.targetRelease }} in pom.xml
28+ uses : jacobtomlinson/gha-find-replace@v2
29+ with :
30+ find : ${{ env.CURRENT_VERSION }}
31+ replace : ${{ github.event.inputs.targetRelease }}
32+ regex : false
33+ include : " **/*pom.xml"
34+ - name : Find and Replace ${{ env.CURRENT_VERSION }} with ${{ github.event.inputs.targetRelease }} in build.gradle
35+ uses : jacobtomlinson/gha-find-replace@v2
36+ with :
37+ find : ${{ env.CURRENT_VERSION }}
38+ replace : ${{ github.event.inputs.targetRelease }}
39+ regex : false
40+ include : " **/*build.gradle"
41+ - name : Find and Replace ${{ env.CURRENT_VERSION }} with ${{ github.event.inputs.targetRelease }} in README.md
42+ uses : jacobtomlinson/gha-find-replace@v2
43+ with :
44+ find : ${{ env.CURRENT_VERSION }}
2145 replace : ${{ github.event.inputs.targetRelease }}
22- regex : false
46+ regex : false
47+ include : " README.md"
48+ - name : Create changelog placeholder for ${{ github.event.inputs.targetRelease }}
49+ uses : jacobtomlinson/gha-find-replace@v2
50+ with :
51+ find : ' ## [Unreleased]'
52+ replace : |
53+ ## [Unreleased]
54+
55+ ## [${{ github.event.inputs.targetRelease }}] - ${{ steps.date.outputs.date }}
56+
57+ <PLEASE REMEBER TO UPDATE CHANGE LOG>
58+
59+ regex : false
60+ include : CHANGELOG.md
61+ - name : Create Release Pull Request
62+ uses : peter-evans/create-pull-request@v3
63+ with :
64+ commit-message : chore:prep release ${{ github.event.inputs.targetRelease }}
65+ token : ${{ secrets.RELEASE }}
66+ signoff : false
67+ branch : prep-release-${{ github.event.inputs.targetRelease }}
68+ delete-branch : true
69+ title : chore:Prep release ${{ github.event.inputs.targetRelease }}
70+ body : |
71+ This is automated release prep. Remember to update [CHANGELOG.md](https://github.com/awslabs/aws-lambda-powertools-java/blob/prep-release-${{ github.event.inputs.targetRelease }}/CHANGELOG.md) to capture changes in this release. Please review changes carefully before merging.
72+
73+ * [ ] Updated CHANGELOG.md
0 commit comments