-
Notifications
You must be signed in to change notification settings - Fork 88
80 lines (75 loc) · 3.9 KB
/
release-prep.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Prepare for maven central release
on:
workflow_dispatch:
inputs:
targetRelease:
description: 'Release number to upgrade to. For example X.X.X. Follow Semantic Versioning when deciding on next version.'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Set current release version env variable
run: |
echo "CURRENT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Find and Replace ${{ env.CURRENT_VERSION }} with ${{ github.event.inputs.targetRelease }} in mkdocs.yml
uses: jacobtomlinson/gha-find-replace@f485fdc3f67a6d87ae6e3d11e41f648c26d7aee3 # v2.0.0
with:
find: 'version: ${{ env.CURRENT_VERSION }}'
replace: 'version: ${{ github.event.inputs.targetRelease }}'
regex: false
include: "mkdocs.yml"
- name: Find and Replace ${{ env.CURRENT_VERSION }} with ${{ github.event.inputs.targetRelease }} in main pom.xml
uses: jacobtomlinson/gha-find-replace@f485fdc3f67a6d87ae6e3d11e41f648c26d7aee3 # v2.0.0
with:
find: ${{ env.CURRENT_VERSION }}
replace: ${{ github.event.inputs.targetRelease }}
regex: false
include: "pom.xml"
- name: Find and Replace ${{ env.CURRENT_VERSION }} with ${{ github.event.inputs.targetRelease }} in modules pom.xml
uses: jacobtomlinson/gha-find-replace@f485fdc3f67a6d87ae6e3d11e41f648c26d7aee3 # v2.0.0
with:
find: ${{ env.CURRENT_VERSION }}
replace: ${{ github.event.inputs.targetRelease }}
regex: false
include: "**/*pom.xml"
- name: Find and Replace ${{ env.CURRENT_VERSION }} with ${{ github.event.inputs.targetRelease }} in build.gradle
uses: jacobtomlinson/gha-find-replace@f485fdc3f67a6d87ae6e3d11e41f648c26d7aee3 # v2.0.0
with:
find: ${{ env.CURRENT_VERSION }}
replace: ${{ github.event.inputs.targetRelease }}
regex: false
include: "**/*build.gradle"
- name: Find and Replace ${{ env.CURRENT_VERSION }} with ${{ github.event.inputs.targetRelease }} in README.md
uses: jacobtomlinson/gha-find-replace@f485fdc3f67a6d87ae6e3d11e41f648c26d7aee3 # v2.0.0
with:
find: ${{ env.CURRENT_VERSION }}
replace: ${{ github.event.inputs.targetRelease }}
regex: false
include: "README.md"
- name: Create changelog placeholder for ${{ github.event.inputs.targetRelease }}
uses: jacobtomlinson/gha-find-replace@f485fdc3f67a6d87ae6e3d11e41f648c26d7aee3 # v2.0.0
with:
find: '## [Unreleased]'
replace: |
## [Unreleased]
## [${{ github.event.inputs.targetRelease }}] - ${{ steps.date.outputs.date }}
<PLEASE REMEBER TO UPDATE CHANGE LOG>
regex: false
include: CHANGELOG.md
- name: Create Release Pull Request
uses: peter-evans/create-pull-request@18f7dc018cc2cd597073088f7c7591b9d1c02672 # v3.14.0
with:
commit-message: chore:prep release ${{ github.event.inputs.targetRelease }}
token: ${{ secrets.RELEASE }}
signoff: false
branch: prep-release-${{ github.event.inputs.targetRelease }}
delete-branch: true
title: chore:Prep release ${{ github.event.inputs.targetRelease }}
body: |
This is automated release prep. Remember to update [CHANGELOG.md](https://github.com/aws-powertools/powertools-lambda-java/blob/prep-release-${{ github.event.inputs.targetRelease }}/CHANGELOG.md) to capture changes in this release. Please review changes carefully before merging.
* [ ] Updated CHANGELOG.md