From 10e3d8790171e9534e2092a33f74c1332d16d4d5 Mon Sep 17 00:00:00 2001 From: Gang Li Date: Tue, 17 Mar 2026 11:33:35 +0800 Subject: [PATCH] Update github actions * checkout action: update to v6 * java action: update to v5, and update java version to 17 * maven-settings-xml-action: update to v22 --- .github/dependabot.yml | 16 +++++++++++++++ .github/workflows/maven-push.yml | 31 ++++++++++++++---------------- .github/workflows/maven-verify.yml | 14 ++++++++------ 3 files changed, 38 insertions(+), 23 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..7f0237b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "maven" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + + - package-ecosystem: "github-actions" # Also update Github actions + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "weekly" diff --git a/.github/workflows/maven-push.yml b/.github/workflows/maven-push.yml index c4e3f75..1f940f3 100644 --- a/.github/workflows/maven-push.yml +++ b/.github/workflows/maven-push.yml @@ -16,7 +16,11 @@ name: maven push -on: [push] +on: + push: + branches: + - 'main' + - '1.x' jobs: build: @@ -25,29 +29,22 @@ jobs: env: MAVEN_OPTS: "-Xmx4096m -Xms2048m -XX:MaxMetaspaceSize=4096m -Xss8m" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up JDK 11 for x64 - uses: actions/setup-java@v3 + uses: actions/setup-java@v5 with: - java-version: '11' + java-version: '17' distribution: 'temurin' architecture: x64 - - uses: s4u/maven-settings-action@v2.8.0 + - name: maven-settings-xml-action + uses: whelk-io/maven-settings-xml-action@v22 + if: ${{ github.event.repository.fork == false }} with: - sonatypeSnapshots: true - - - uses: s4u/maven-settings-action@v2.8.0 - if: ${{ github.event_name == 'push' }} - with: - servers: | - [{ - "id": "central-portal-snapshots", - "username": "${{ secrets.SONATYPE_BOT_USERNAME }}", - "password": "${{ secrets.SONATYPE_BOT_TOKEN }}" - }] - + repositories: '[{ "id": "sonatype", "url": "https://oss.sonatype.org/content/repositories/snapshots/", "releases": {"enabled": "false"}, "snapshots": {"enabled": "true" }}]' + servers: '[{ "id": "sonatype", "username": "${{ secrets.SONATYPE_BOT_USERNAME}}", "password": "${{ secrets.SONATYPE_BOT_TOKEN}}" }]' + - name: Deploy the artifact if: ${{ github.event_name == 'push' }} run: mvn help:effective-settings -B -V clean deploy -e \ No newline at end of file diff --git a/.github/workflows/maven-verify.yml b/.github/workflows/maven-verify.yml index 9c8c85a..76c1652 100644 --- a/.github/workflows/maven-verify.yml +++ b/.github/workflows/maven-verify.yml @@ -25,18 +25,20 @@ jobs: env: MAVEN_OPTS: "-Xmx4096m -Xms2048m -XX:MaxMetaspaceSize=4096m -Xss8m" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - name: Set up JDK 11 for x64 - uses: actions/setup-java@v3 + - name: Set up JDK + uses: actions/setup-java@v5 with: - java-version: '11' + java-version: '17' distribution: 'temurin' architecture: x64 - - uses: s4u/maven-settings-action@v2.8.0 + - name: maven-settings-xml-action + uses: whelk-io/maven-settings-xml-action@v22 with: - sonatypeSnapshots: true + repositories: '[{ "id": "sonatype", "url": "https://oss.sonatype.org/content/repositories/snapshots/", "releases": {"enabled": "false"}, "snapshots": {"enabled": "true" }}]' + - name: Build the Maven verify phase run: mvn -B -V clean verify -Prun-its -Pci