Prepare for maven central release #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | |
- 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@v2 | |
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@v2 | |
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@v2 | |
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@v2 | |
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@v2 | |
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@v2 | |
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@v3 | |
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 |