Skip to content

Commit 1daf96e

Browse files
chore: Automate release prep (#696)
1 parent 0722e92 commit 1daf96e

File tree

9 files changed

+80
-25
lines changed

9 files changed

+80
-25
lines changed

.github/workflows/release-prep.yml

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,71 @@ on:
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

129
jobs:
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

docs/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
FROM squidfunk/mkdocs-material
2-
RUN pip install mkdocs-git-revision-date-plugin
2+
RUN pip install mkdocs-git-revision-date-plugin mkdocs-macros-plugin

docs/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ For more information about the project and available options refer to this [repo
4646
<dependency>
4747
<groupId>software.amazon.lambda</groupId>
4848
<artifactId>powertools-tracing</artifactId>
49-
<version>1.10.1</version>
49+
<version>{{ powertools.version }}</version>
5050
</dependency>
5151
<dependency>
5252
<groupId>software.amazon.lambda</groupId>
5353
<artifactId>powertools-logging</artifactId>
54-
<version>1.10.1</version>
54+
<version>{{ powertools.version }}</version>
5555
</dependency>
5656
<dependency>
5757
<groupId>software.amazon.lambda</groupId>
5858
<artifactId>powertools-metrics</artifactId>
59-
<version>1.10.1</version>
59+
<version>{{ powertools.version }}</version>
6060
</dependency>
6161
...
6262
</dependencies>
@@ -114,9 +114,9 @@ For more information about the project and available options refer to this [repo
114114
}
115115

116116
dependencies {
117-
aspect 'software.amazon.lambda:powertools-logging:1.10.1'
118-
aspect 'software.amazon.lambda:powertools-tracing:1.10.1'
119-
aspect 'software.amazon.lambda:powertools-metrics:1.10.1'
117+
aspect 'software.amazon.lambda:powertools-logging:{{ powertools.version }}'
118+
aspect 'software.amazon.lambda:powertools-tracing:{{ powertools.version }}'
119+
aspect 'software.amazon.lambda:powertools-metrics:{{ powertools.version }}'
120120
}
121121
```
122122

docs/utilities/batch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ To install this utility, add the following dependency to your project.
3232
<dependency>
3333
<groupId>software.amazon.lambda</groupId>
3434
<artifactId>powertools-sqs</artifactId>
35-
<version>1.10.1</version>
35+
<version>{{ powertools.version }}</version>
3636
</dependency>
3737
...
3838
</dependencies>
@@ -82,7 +82,7 @@ To install this utility, add the following dependency to your project.
8282

8383
dependencies {
8484
...
85-
aspect 'software.amazon.lambda:powertools-sqs:1.10.1'
85+
aspect 'software.amazon.lambda:powertools-sqs:{{ powertools.version }}'
8686
}
8787
```
8888

docs/utilities/custom_resources.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To install this utility, add the following dependency to your project.
2424
<dependency>
2525
<groupId>software.amazon.lambda</groupId>
2626
<artifactId>powertools-cloudformation</artifactId>
27-
<version>1.10.1</version>
27+
<version>{{ powertools.version }}</version>
2828
</dependency>
2929
```
3030

@@ -33,7 +33,7 @@ To install this utility, add the following dependency to your project.
3333
```groovy
3434
dependencies {
3535
...
36-
implementation 'software.amazon.lambda:powertools-cloudformation:1.10.1'
36+
implementation 'software.amazon.lambda:powertools-cloudformation:{{ powertools.version }}'
3737
}
3838
```
3939

docs/utilities/parameters.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ To install this utility, add the following dependency to your project.
2424
<dependency>
2525
<groupId>software.amazon.lambda</groupId>
2626
<artifactId>powertools-parameters</artifactId>
27-
<version>1.10.1</version>
27+
<version>{{ powertools.version }}</version>
2828
</dependency>
2929
```
3030
=== "Gradle"
3131

3232
```groovy
3333
dependencies {
3434
...
35-
aspect 'software.amazon.lambda:powertools-parameters:1.10.1'
35+
aspect 'software.amazon.lambda:powertools-parameters:{{ powertools.version }}'
3636
}
3737
```
3838

@@ -433,6 +433,6 @@ If you want to use the ```@Param``` annotation in your project add configuration
433433

434434
dependencies {
435435
...
436-
aspect 'software.amazon.lambda:powertools-parameters:1.10.1'
436+
aspect 'software.amazon.lambda:powertools-parameters:{{ powertools.version }}'
437437
}
438438
```

docs/utilities/sqs_large_message_handling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ To install this utility, add the following dependency to your project.
4040
<dependency>
4141
<groupId>software.amazon.lambda</groupId>
4242
<artifactId>powertools-sqs</artifactId>
43-
<version>1.10.1</version>
43+
<version>{{ powertools.version }}</version>
4444
</dependency>
4545
...
4646
</dependencies>
@@ -90,7 +90,7 @@ To install this utility, add the following dependency to your project.
9090

9191
dependencies {
9292
...
93-
aspect 'software.amazon.lambda:powertools-sqs:1.10.1'
93+
aspect 'software.amazon.lambda:powertools-sqs:{{ powertools.version }}'
9494
}
9595
```
9696

docs/utilities/validation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ To install this utility, add the following dependency to your project.
2222
<dependency>
2323
<groupId>com.amazonaws</groupId>
2424
<artifactId>powertools-validation</artifactId>
25-
<version>1.10.1</version>
25+
<version>{{ powertools.version }}</version>
2626
</dependency>
2727
...
2828
</dependencies>
@@ -71,7 +71,7 @@ To install this utility, add the following dependency to your project.
7171
}
7272

7373
dependencies {
74-
aspect 'software.amazon.lambda:powertools-validation:1.10.1'
74+
aspect 'software.amazon.lambda:powertools-validation:{{ powertools.version }}'
7575
}
7676
```
7777

mkdocs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,17 @@ copyright: Copyright &copy; 2021 Amazon Web Services
6565
plugins:
6666
- git-revision-date
6767
- search
68+
- macros
6869

6970
extra_css:
7071
- stylesheets/extra.css
7172
extra_javascript:
7273
- javascript/aws-amplify.min.js
7374
- javascript/extra.js
7475

76+
extra:
77+
powertools:
78+
version: 1.10.1
7579

7680
repo_url: https://github.com/awslabs/aws-lambda-powertools-java
7781
edit_uri: edit/master/docs

0 commit comments

Comments
 (0)