Fixing versions action #2
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: Versions Update | |
on: | |
push: | |
branches: [ master ] | |
paths: | |
- '.github/workflows/version_update.yml' | |
schedule: | |
# Run once on the first of the month | |
- cron: '45 0 1 * *' | |
jobs: | |
update: | |
name: Versions Update | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK 22 | |
uses: actions/setup-java@v4.2.1 | |
with: | |
distribution: 'temurin' | |
java-version: '22' | |
- name: Cache local .m2 | |
uses: actions/cache@v4.0.2 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Set up maven | |
uses: s4u/setup-maven-action@v1.14.0 | |
with: | |
java-distribution: 'temurin' | |
java-version: '22' | |
maven-version: '3.9.8' | |
- name: Update Maven project versions | |
run: mvn versions:update-properties | |
- name: Run linters and unit/integration tests | |
id: application_tests | |
run: mvn clean install -Dall | |
- name: Commit and push changes | |
if: steps.application_tests.outcome == 'success' | |
run: | | |
git config --global user.name 'GitHub Actions' | |
git config --global user.email 'actions@github.com' | |
git add . | |
git commit -m 'Updating versions' | |
git push |