Skip to content

Update Spring-Modulith Parent POM Version #80

Update Spring-Modulith Parent POM Version

Update Spring-Modulith Parent POM Version #80

name: Update Spring-Modulith Parent POM Version
on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight
workflow_dispatch:
jobs:
update-parent-pom:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: maintenance/1.0.x
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Update parent POM version
id: update-parent-pom
run: |
NEW_VERSION=$(curl -s "https://repo1.maven.org/maven2/org/springframework/modulith/spring-modulith-events/maven-metadata.xml" | grep -oP '<version>1\.4\.[0-9]+</version>' | grep -oP '1\.4\.[0-9]+' | sort -V | tail -1)
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT
mvn versions:update-parent -DparentVersion=${NEW_VERSION} -DskipResolution=true -DgenerateBackupPoms=false
- name: Build with new parent version
run: mvn clean verify -B
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: 'Update Spring-Modulith Parent POM version to ${{ steps.update-parent-pom.outputs.NEW_VERSION }}'
branch: update-parent-pom-${{ steps.update-parent-pom.outputs.NEW_VERSION }}
title: 'Update Spring-Modulith Parent POM version to ${{ steps.update-parent-pom.outputs.NEW_VERSION }}'
body: 'This PR updates Spring-Modulith Parent POM version to ${{ steps.update-parent-pom.outputs.NEW_VERSION }}'
labels: 'dependencies'
base: maintenance/1.0.x