ci: update dependabot and workflows
diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3fe6cb7..8c3d5d9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml
@@ -9,7 +9,7 @@ - "bot" - package-ecosystem: "maven" - directory: "/api" + directory: "/" schedule: interval: "daily" labels: @@ -17,17 +17,9 @@ - "bot" - package-ecosystem: "maven" - directory: "/spec" + directory: "/perf" schedule: - interval: "daily" - labels: - - "dependencies" - - "bot" - - - package-ecosystem: "maven" - directory: "/tck" - schedule: - interval: "daily" + interval: "weekly" labels: - "dependencies" - "bot"
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index d189a3d..4022c68 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml
@@ -38,5 +38,5 @@ distribution: 'temurin' java-version: ${{ matrix.java_version }} cache: 'maven' - - name: Verify - run: cd api && mvn -B -V -U -C -Poss-release -Pstaging clean verify -Dgpg.skip=true + - name: Package + run: mvn -B -V -U -C clean package
diff --git a/.github/workflows/update-signature.yml b/.github/workflows/update-signature.yml new file mode 100644 index 0000000..6ebdb18 --- /dev/null +++ b/.github/workflows/update-signature.yml
@@ -0,0 +1,87 @@ +# +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0, +# or the Eclipse Distribution License v. 1.0 which is available at +# http://www.eclipse.org/org/documents/edl-v10.php. +# +# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause +# + +# Re-generates the TCK signature file(s) whenever the API module is updated. +# If the generated signature differs from the committed one, a pull request is opened. +# Can also be run manually using workflow_dispatch. + +name: Update signature files + +on: + push: + branches: + - 'main' + paths: + - 'api/src/**' + workflow_dispatch: # For manual testing + +permissions: + contents: write + pull-requests: write + +concurrency: + group: update-signature-${{ github.ref }} + cancel-in-progress: false + +jobs: + update: + name: Update signature file for JDK ${{ matrix.java_version }} + runs-on: ubuntu-latest + + strategy: + max-parallel: 1 + matrix: + java_version: [ 17 ] # Add other Java versions if multiple signature files are supported. + + env: + SIGNATURE_DIR: tck/tck-tests/src/main/resources/ee/jakarta/tck/jsonp/signaturetest + UPDATE_BRANCH: update-signature-files-${{ github.sha }} + + steps: + - name: Checkout source + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Set up JDK ${{ matrix.java_version }} + uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0 + with: + distribution: 'temurin' + java-version: ${{ matrix.java_version }} + cache: 'maven' + - name: Generate signature file + run: | + mvn -B -V -U -C install -N -DskipTests + mvn -B -V -U -C install -f api/pom.xml -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true + mvn -B -V -U -C package -N -f tck/pom.xml -Psignature-generation -Djdk.major.version=${{ matrix.java_version }} + - name: Check for changes + id: changes + run: | + git add --intent-to-add "${SIGNATURE_DIR}" + if git diff --quiet -- "${SIGNATURE_DIR}"; then + echo "changed=false" >> "$GITHUB_OUTPUT" + else + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + - name: Create pull request + if: steps.changes.outputs.changed == 'true' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config user.name "github-actions[bot]" + git checkout -b "${UPDATE_BRANCH}" + git add "${SIGNATURE_DIR}" + git commit -s -m "Update signature file for JDK ${{ matrix.java_version }}" + git push origin "${UPDATE_BRANCH}" + gh pr create \ + --base "${{ github.ref_name }}" \ + --head "${UPDATE_BRANCH}" \ + --title "Update signature file for JDK ${{ matrix.java_version }}" \ + --body "Generated from ${{ github.sha }} after a change to the API module."
diff --git a/tck/pom.xml b/tck/pom.xml index ccb227c..4fa35fd 100644 --- a/tck/pom.xml +++ b/tck/pom.xml
@@ -105,6 +105,14 @@ <!--Default assumed JDK version, can be overridden via -Djdk.major.version=X --> <jdk.major.version>${maven.compiler.release}</jdk.major.version> </properties> + <dependencies> + <!-- API classes are picked up by sigtest-maven-plugin from the project classpath --> + <dependency> + <groupId>jakarta.json</groupId> + <artifactId>jakarta.json-api</artifactId> + <scope>provided</scope> + </dependency> + </dependencies> <build> <plugins> <!-- Unpacks the API jar into target/json-api for use by sigtest-maven-plugin --> @@ -183,6 +191,7 @@ jakarta.json.spi, jakarta.json.stream </packages> + <version>${project.version}</version> <attach>false</attach> <sigfile>${project.build.directory}/jakarta.json.sig_${jdk.major.version}</sigfile> </configuration>