| # Licensed to the Apache Software Foundation (ASF) under one | |
| # or more contributor license agreements. See the NOTICE file | |
| # distributed with this work for additional information | |
| # regarding copyright ownership. The ASF licenses this file | |
| # to you under the Apache License, Version 2.0 (the | |
| # "License"); you may not use this file except in compliance | |
| # with the License. You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, | |
| # software distributed under the License is distributed on an | |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| # KIND, either express or implied. See the License for the | |
| # specific language governing permissions and limitations | |
| # under the License. | |
| name: Update lifecycle plugin versions | |
| on: | |
| schedule: | |
| # Every Monday at 08:00 UTC | |
| - cron: '0 8 * * 1' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| update-lifecycle-plugins: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| branch: [master, maven-4.0.x] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| ref: ${{ matrix.branch }} | |
| - uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: maven | |
| cache-jdk: false | |
| - name: Update lifecycle plugin versions | |
| run: | | |
| mvn -B versions:update-properties \ | |
| -P?versions-update \ | |
| -DallowMajorUpdates=false \ | |
| -DincludeProperties="lifecycle.maven-clean-plugin,lifecycle.maven-compiler-plugin,lifecycle.maven-deploy-plugin,lifecycle.maven-ear-plugin,lifecycle.maven-ejb-plugin,lifecycle.maven-install-plugin,lifecycle.maven-jar-plugin,lifecycle.maven-plugin-plugin,lifecycle.maven-rar-plugin,lifecycle.maven-resources-plugin,lifecycle.maven-site-plugin,lifecycle.maven-surefire-plugin,lifecycle.maven-war-plugin" \ | |
| -pl impl/maven-core | |
| - name: Open or update pull request | |
| if: ${{ !cancelled() }} | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN || github.token }} | |
| run: | | |
| BRANCH="update/lifecycle-plugins-${{ matrix.branch }}" | |
| if git diff --quiet impl/maven-core/pom.xml; then | |
| echo "No updates found for ${{ matrix.branch }}" | |
| exit 0 | |
| fi | |
| echo "--- Updated properties ---" | |
| git diff impl/maven-core/pom.xml | grep '^[+-].*lifecycle\.' | grep -v '^---\|^+++' | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git checkout -b "${BRANCH}" | |
| git add impl/maven-core/pom.xml | |
| git commit -m "chore: update Maven lifecycle plugin versions" | |
| git push --force --set-upstream origin "${BRANCH}" | |
| gh pr create \ | |
| --base "${{ matrix.branch }}" \ | |
| --head "${BRANCH}" \ | |
| --title "chore: update Maven lifecycle plugin versions (${{ matrix.branch }})" \ | |
| --body "Automated update of Maven lifecycle plugin versions via \`versions:update-properties\`. These versions are declared in \`impl/maven-core/pom.xml\` and are used by the Maven default lifecycle binding. They are filtered at build time into \`plugin-versions.properties\` and loaded at runtime by \`PluginVersions\`. This PR was created automatically by the \`update-lifecycle-plugins\` workflow." \ | |
| --label "dependencies" \ | |
| || gh pr edit "${BRANCH}" \ | |
| --title "chore: update Maven lifecycle plugin versions (${{ matrix.branch }})" \ | |
| --body "Automated update of Maven lifecycle plugin versions via \`versions:update-properties\`. These versions are declared in \`impl/maven-core/pom.xml\` and are used by the Maven default lifecycle binding. They are filtered at build time into \`plugin-versions.properties\` and loaded at runtime by \`PluginVersions\`. This PR was created automatically by the \`update-lifecycle-plugins\` workflow." |