diff --git a/.editorconfig b/.editorconfig index 2a4ad4ec1b55..b49a2d432075 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,17 @@ +root = true + +[*] +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.bat] +end_of_line = crlf + +[*.md] +# Trailing whitespace is important in Markdown (they distinguish a new line from a new paragraph) +trim_trailing_whitespace = false + [*.{kt,kts}] ij_kotlin_allow_trailing_comma = false ij_kotlin_allow_trailing_comma_on_call_site = false diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 57a6f10876d6..65eddb565fd1 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -5,7 +5,7 @@ type: Bug labels: ["type: bug"] --- - + ## Steps to reproduce diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 93fa0b266326..eeb371ed465e 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,7 +1,7 @@ blank_issues_enabled: false contact_links: - name: Ask a question - url: https://github.com/junit-team/junit5/discussions/categories/q-a + url: https://github.com/junit-team/junit-framework/discussions/categories/q-a about: Please ask and answer questions here - name: Ask a question (Stack Overflow) url: https://stackoverflow.com/questions/tagged/junit5 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 90d0d4bdaed2..cfeb6a90b3ee 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,15 +4,15 @@ --- -I hereby agree to the terms of the [JUnit Contributor License Agreement](https://github.com/junit-team/junit5/blob/002a0052926ddee57cf90580fa49bc37e5a72427/CONTRIBUTING.md#junit-contributor-license-agreement). +I hereby agree to the terms of the [JUnit Contributor License Agreement](https://github.com/junit-team/junit-framework/blob/002a0052926ddee57cf90580fa49bc37e5a72427/CONTRIBUTING.md#junit-contributor-license-agreement). --- ### Definition of Done - [ ] There are no TODOs left in the code -- [ ] Method [preconditions](https://junit.org/junit5/docs/snapshot/api/org.junit.platform.commons/org/junit/platform/commons/util/Preconditions.html) are checked and documented in the method's Javadoc -- [ ] [Coding conventions](https://github.com/junit-team/junit5/blob/HEAD/CONTRIBUTING.md#coding-conventions) (e.g. for logging) have been followed -- [ ] Change is covered by [automated tests](https://github.com/junit-team/junit5/blob/HEAD/CONTRIBUTING.md#tests) including corner cases, errors, and exception handling -- [ ] Public API has [Javadoc](https://github.com/junit-team/junit5/blob/HEAD/CONTRIBUTING.md#javadoc) and [`@API` annotations](https://apiguardian-team.github.io/apiguardian/docs/current/api/org/apiguardian/api/API.html) -- [ ] Change is documented in the [User Guide](https://junit.org/junit5/docs/snapshot/user-guide/) and [Release Notes](https://junit.org/junit5/docs/snapshot/user-guide/#release-notes) +- [ ] Method [preconditions](https://docs.junit.org/snapshot/api/org.junit.platform.commons/org/junit/platform/commons/util/Preconditions.html) are checked and documented in the method's Javadoc +- [ ] [Coding conventions](https://github.com/junit-team/junit-framework/blob/HEAD/CONTRIBUTING.md#coding-conventions) (e.g. for logging) have been followed +- [ ] Change is covered by [automated tests](https://github.com/junit-team/junit-framework/blob/HEAD/CONTRIBUTING.md#tests) including corner cases, errors, and exception handling +- [ ] Public API has [Javadoc](https://github.com/junit-team/junit-framework/blob/HEAD/CONTRIBUTING.md#javadoc) and [`@API` annotations](https://apiguardian-team.github.io/apiguardian/docs/current/api/org/apiguardian/api/API.html) +- [ ] Change is documented in the [User Guide](https://docs.junit.org/snapshot/user-guide/) and [Release Notes](https://docs.junit.org/snapshot/user-guide/#release-notes) diff --git a/.github/actions/run-gradle/action.yml b/.github/actions/run-gradle/action.yml index 7506f777a7ce..06b1affcf7ff 100644 --- a/.github/actions/run-gradle/action.yml +++ b/.github/actions/run-gradle/action.yml @@ -15,9 +15,9 @@ runs: id: setup-gradle-jdk with: distribution: temurin - java-version: 21 + java-version: 24 check-latest: true - - uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1 + - uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1 with: cache-encryption-key: ${{ inputs.encryptionKey }} - shell: bash diff --git a/.github/actions/setup-test-jdk/action.yml b/.github/actions/setup-test-jdk/action.yml index b2d6b1dbc46b..9e650112b77b 100644 --- a/.github/actions/setup-test-jdk/action.yml +++ b/.github/actions/setup-test-jdk/action.yml @@ -15,3 +15,10 @@ runs: check-latest: true - shell: bash run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV + - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4 + with: + distribution: ${{ inputs.distribution }} + java-version: 17 + check-latest: true + - shell: bash + run: echo "JDK17=$JAVA_HOME" >> $GITHUB_ENV diff --git a/.github/renovate.json5 b/.github/renovate.json5 index d256a62d0f55..ea024d3d17e6 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -3,7 +3,6 @@ extends: [ 'github>junit-team/renovate-config', ], - baseBranches: ["main", "/^develop\\/.*/"], packageRules: [ { matchCurrentValue: '/^2\\./', diff --git a/.github/scripts/waitForMavenCentralSync.sh b/.github/scripts/waitForMavenCentralSync.sh deleted file mode 100755 index 9a281e56d7ba..000000000000 --- a/.github/scripts/waitForMavenCentralSync.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -URL_PATH=$1 -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -"$SCRIPT_DIR"/waitForUrl.sh "https://repo1.maven.org/maven2/$URL_PATH" diff --git a/.github/workflows/close-inactive-issues.yml b/.github/workflows/close-inactive-issues.yml index 4453ca192264..2a76f9cd147d 100644 --- a/.github/workflows/close-inactive-issues.yml +++ b/.github/workflows/close-inactive-issues.yml @@ -3,7 +3,7 @@ on: schedule: - cron: "30 1 * * *" workflow_dispatch: -permissions: read-all +permissions: {} jobs: close-issues: runs-on: ubuntu-latest diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql.yml similarity index 60% rename from .github/workflows/codeql-analysis.yml rename to .github/workflows/codeql.yml index 5664eeca4c65..817ab007f246 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql.yml @@ -13,38 +13,46 @@ on: schedule: - cron: '0 19 * * 3' -permissions: read-all +permissions: {} env: DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} jobs: analyze: - name: Analyze + name: Analyze (${{ matrix.language }}) runs-on: ubuntu-latest permissions: security-events: write strategy: fail-fast: false matrix: - language: - - java - - javascript + include: + - language: actions + build-mode: none + - language: java-kotlin + build-mode: manual + - language: javascript + build-mode: none steps: - name: Check out repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 + uses: github/codeql-action/init@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0 with: languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} tools: linked - name: Build + if: matrix.build-mode == 'manual' uses: ./.github/actions/run-gradle with: encryptionKey: ${{ secrets.GRADLE_ENCRYPTION_KEY }} arguments: | --no-build-cache \ -Dscan.tag.CodeQL \ - allMainClasses + classes - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 + uses: github/codeql-action/analyze@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 7c51412feaaf..04f821a7f109 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -11,7 +11,7 @@ on: branches: - '**' -permissions: read-all +permissions: {} env: DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} @@ -22,10 +22,10 @@ jobs: fail-fast: false matrix: jdk: - - version: 24 - type: ga - version: 25 type: ea + - version: 26 + type: ea name: "OpenJDK ${{ matrix.jdk.version }} (${{ matrix.jdk.release || matrix.jdk.type }})" runs-on: ubuntu-latest steps: @@ -37,7 +37,7 @@ jobs: uses: ./.github/actions/setup-test-jdk - name: "Set up JDK ${{ matrix.jdk.version }} (${{ matrix.jdk.release || 'ea' }})" if: matrix.jdk.type == 'ea' - uses: oracle-actions/setup-java@8fb9d7717810ccde9f8d4bef1e6f43d180f506b5 # v1.4.1 + uses: oracle-actions/setup-java@b1546e588c27008e88bfcabda44d11c22316b9b8 # v1.4.2 with: website: jdk.java.net release: ${{ matrix.jdk.release || matrix.jdk.version }} diff --git a/.github/workflows/gradle-dependency-submission.yml b/.github/workflows/gradle-dependency-submission.yml index d99e7d48ca52..7f3831fa0390 100644 --- a/.github/workflows/gradle-dependency-submission.yml +++ b/.github/workflows/gradle-dependency-submission.yml @@ -5,11 +5,14 @@ on: branches: - main -permissions: read-all +permissions: {} + +env: + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} jobs: dependency-submission: - if: github.repository == 'junit-team/junit5' + if: github.repository == 'junit-team/junit-framework' runs-on: ubuntu-latest permissions: contents: write @@ -22,7 +25,7 @@ jobs: uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 with: distribution: temurin - java-version: 21 + java-version: 24 check-latest: true - name: Generate and submit dependency graph - uses: gradle/actions/dependency-submission@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1 + uses: gradle/actions/dependency-submission@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1 diff --git a/.github/workflows/label-opened-issues.yml b/.github/workflows/label-opened-issues.yml index f18377bd22a1..10a5dee96dee 100644 --- a/.github/workflows/label-opened-issues.yml +++ b/.github/workflows/label-opened-issues.yml @@ -3,7 +3,7 @@ on: issues: types: - opened -permissions: read-all +permissions: {} jobs: label_issues: runs-on: ubuntu-latest diff --git a/.github/workflows/label-pull-request.yml b/.github/workflows/label-pull-request.yml new file mode 100644 index 000000000000..8f3807caad7f --- /dev/null +++ b/.github/workflows/label-pull-request.yml @@ -0,0 +1,52 @@ +name: Copy labels from linked issues to PR +on: + pull_request: + types: [opened, reopened, edited, synchronize] +permissions: {} +jobs: + copy_labels: + name: Copy labels + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: | + const query = ` + query($owner: String!, $repo: String!, $pr: Int!) { + repository(owner: $owner, name: $repo) { + pullRequest(number: $pr) { + closingIssuesReferences(first: 10) { + nodes { + labels(first: 100) { + nodes { + name + } + } + } + } + } + } + } + `; + + const {repository} = await github.graphql(query, { + owner: context.repo.owner, + repo: context.repo.repo, + pr: context.issue.number + }); + + let labels = Array.from(new Set(repository.pullRequest.closingIssuesReferences.nodes + .flatMap((node) => node.labels.nodes.map((label) => label.name)))) + .filter((label) => !label.startsWith("status:")); + + if (labels.length > 0) { + console.log(`Adding labels to PR: ${labels}`); + await github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: labels + }); + } diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aadc10b78069..097c882b871b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ on: branches: - '**' -permissions: read-all +permissions: {} env: DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} @@ -25,12 +25,11 @@ jobs: with: fetch-depth: 1 - name: Install GraalVM - uses: graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # v1.3.3 + uses: graalvm/setup-graalvm@e1df20a713a4cc6ab5b0eb03f0e0dcdc0199b805 # v1.3.4 with: distribution: graalvm-community version: 'latest' java-version: '21' - github-token: ${{ secrets.GITHUB_TOKEN }} - name: Build uses: ./.github/actions/main-build with: @@ -76,7 +75,7 @@ jobs: permissions: attestations: write # required for build provenance attestation id-token: write # required for build provenance attestation - if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && (startsWith(github.ref, 'refs/heads/releases/') || github.ref == 'refs/heads/main') + if: github.event_name == 'push' && github.repository == 'junit-team/junit-framework' && (startsWith(github.ref, 'refs/heads/releases/') || github.ref == 'refs/heads/main') steps: - name: Check out repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -93,7 +92,7 @@ jobs: publish -x check \ prepareGitHubAttestation - name: Generate build provenance attestations - uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0 + uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0 with: subject-path: documentation/build/attestation/*.jar @@ -126,7 +125,7 @@ jobs: git config --global user.name "JUnit Team" git config --global user.email "team@junit.org" - name: Upload Documentation - if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && github.ref == 'refs/heads/main' + if: github.event_name == 'push' && github.repository == 'junit-team/junit-framework' && github.ref == 'refs/heads/main' uses: ./.github/actions/run-gradle with: encryptionKey: ${{ secrets.GRADLE_ENCRYPTION_KEY }} @@ -135,4 +134,4 @@ jobs: -Dscan.tag.Documentation env: GIT_USERNAME: git - GIT_PASSWORD: ${{ secrets.GH_TOKEN }} + GIT_PASSWORD: ${{ secrets.JUNIT_BUILDS_GITHUB_TOKEN_DOCS_REPO }} diff --git a/.github/workflows/ossf-scorecard.yml b/.github/workflows/ossf-scorecard.yml index c24ae2e85e54..18cacbc0cc06 100644 --- a/.github/workflows/ossf-scorecard.yml +++ b/.github/workflows/ossf-scorecard.yml @@ -7,7 +7,7 @@ on: push: branches: [ "main" ] -permissions: read-all +permissions: {} jobs: analysis: @@ -26,7 +26,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1 + uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2 with: results_file: results.sarif results_format: sarif @@ -57,6 +57,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard (optional). # Commenting out will disable upload of results to your repo's Code Scanning dashboard - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 + uses: github/codeql-action/upload-sarif@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0 with: sarif_file: results.sarif diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6988b6e873b6..0c736d216ba0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,12 +15,12 @@ on: required: false default: false -permissions: read-all +permissions: {} env: DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} - STAGING_REPO_URL: https://central.sonatype.com/api/v1/publisher/deployment/${{ github.event.inputs.deploymentId }}/download - RELEASE_TAG: r${{ github.event.inputs.releaseVersion }} + STAGING_REPO_URL: https://central.sonatype.com/api/v1/publisher/deployment/${{ inputs.deploymentId }}/download + RELEASE_TAG: r${{ inputs.releaseVersion }} jobs: @@ -46,7 +46,7 @@ jobs: run: | curl --silent --fail --location --output /tmp/reference.jar \ --header "Authorization: Bearer $MAVEN_CENTRAL_USER_TOKEN" \ - "${{ env.STAGING_REPO_URL }}/org/junit/jupiter/junit-jupiter-api/${{ github.event.inputs.releaseVersion }}/junit-jupiter-api-${{ github.event.inputs.releaseVersion }}.jar" + "${{ env.STAGING_REPO_URL }}/org/junit/jupiter/junit-jupiter-api/${{ inputs.releaseVersion }}/junit-jupiter-api-${{ inputs.releaseVersion }}.jar" sudo apt-get update && sudo apt-get install --yes jc unzip -c /tmp/reference.jar META-INF/MANIFEST.MF | jc --jar-manifest | jq '.[0]' > /tmp/manifest.json echo "createdBy=$(jq --raw-output .Created_By /tmp/manifest.json)" >> "$GITHUB_OUTPUT" @@ -63,14 +63,9 @@ jobs: --remote-repo-url=${{ env.STAGING_REPO_URL }} - name: Generate build provenance attestations if: ${{ inputs.dryRun == false }} - uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0 + uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0 with: subject-path: build/repo/**/*.jar - - name: Upload local repository for later jobs - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - with: - name: local-maven-repository - path: build/repo verify_consumability: name: Verify consumability @@ -81,36 +76,37 @@ jobs: with: fetch-depth: 1 ref: "refs/tags/${{ env.RELEASE_TAG }}" - path: junit5 - - name: Check out samples repository + path: junit-framework + - name: Check out examples repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: - repository: ${{ github.repository_owner }}/junit5-samples - token: ${{ secrets.GH_TOKEN }} + repository: ${{ github.repository_owner }}/junit-examples + token: ${{ secrets.JUNIT_BUILDS_GITHUB_TOKEN_EXAMPLES_REPO }} fetch-depth: 1 - path: junit5-samples + path: junit-examples + ref: develop/6.x - name: Set up JDK uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 with: - java-version: 21 + java-version: 24 distribution: temurin - - uses: sbt/setup-sbt@26ab4b0fa1c47fa62fc1f6e51823a658fb6c760c # v1.1.7 - - name: Update JUnit dependencies in samples - run: java src/Updater.java ${{ github.event.inputs.releaseVersion }} - working-directory: junit5-samples + - uses: sbt/setup-sbt@234370af1319038bf8dc432f8a7e4b83078a1781 # v1.1.11 + - name: Update JUnit dependencies in examples + run: java src/Updater.java ${{ inputs.releaseVersion }} + working-directory: junit-examples - name: Prepare Maven Central user token - uses: ./junit5/.github/actions/maven-central-user-token + uses: ./junit-framework/.github/actions/maven-central-user-token with: username: ${{ secrets.MAVEN_CENTRAL_USERNAME }} password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - name: Inject staging repository URL run: java src/StagingRepoInjector.java ${{ env.STAGING_REPO_URL }} - working-directory: junit5-samples - - name: Build samples - run: java src/Builder.java --exclude=junit5-jupiter-starter-bazel,junit5-jupiter-starter-sbt - working-directory: junit5-samples + working-directory: junit-examples + - name: Build examples + run: java src/Builder.java --exclude=junit-jupiter-starter-bazel,junit-jupiter-starter-sbt + working-directory: junit-examples env: - MAVEN_ARGS: --settings ${{ github.workspace }}/junit5-samples/src/central-staging-maven-settings.xml --activate-profiles central-staging + MAVEN_ARGS: --settings ${{ github.workspace }}/junit-examples/src/central-staging-maven-settings.xml --activate-profiles central-staging close_github_milestone: name: Close GitHub milestone @@ -124,17 +120,30 @@ jobs: with: result-encoding: string script: | - const openMilestones = await github.rest.issues.listMilestones({ + const query = ` + query ($owner: String!, $repo: String!, $title: String!) { + repository(owner: $owner, name: $repo) { + milestones(first: 100, query: $title) { + nodes { + title + number + openIssueCount + } + } + } + } + `; + const {repository} = await github.graphql(query, { owner: context.repo.owner, repo: context.repo.repo, - state: 'open' + title: "${{ inputs.releaseVersion }}" }); - const [milestone] = openMilestones.data.filter(x => x.title === "${{ github.event.inputs.releaseVersion }}") + const [milestone] = repository.milestones.nodes.filter(it => it.title === "${{ inputs.releaseVersion }}") if (!milestone) { - throw new Error('Milestone "${{ github.event.inputs.releaseVersion }}" not found'); + throw new Error('Milestone "${{ inputs.releaseVersion }}" not found'); } - if (milestone.open_issues > 0) { - throw new Error(`Milestone "${{ github.event.inputs.releaseVersion }}" has ${milestone.open_issues} open issue(s)`); + if (milestone.openIssueCount > 0) { + throw new Error(`Milestone "${{ inputs.releaseVersion }}" has ${milestone.openIssueCount} open issue(s)`); } const requestBody = { owner: context.repo.owner, @@ -195,26 +204,26 @@ jobs: --no-configuration-cache \ clean \ gitPublishCopy \ - -Pdocumentation.replaceCurrentDocs=${{ contains(github.event.inputs.releaseVersion, '-') && 'false' || 'true' }} + -Pdocumentation.replaceCurrentDocs=${{ contains(inputs.releaseVersion, '-') && 'false' || 'true' }} - name: Publish documentation if: ${{ inputs.dryRun == false }} uses: ./.github/actions/run-gradle env: GIT_USERNAME: git - GIT_PASSWORD: ${{ secrets.GH_TOKEN }} + GIT_PASSWORD: ${{ secrets.JUNIT_BUILDS_GITHUB_TOKEN_DOCS_REPO }} with: encryptionKey: ${{ secrets.GRADLE_ENCRYPTION_KEY }} arguments: | --no-build-cache \ --no-configuration-cache \ gitPublishPush \ - -Pdocumentation.replaceCurrentDocs=${{ contains(github.event.inputs.releaseVersion, '-') && 'false' || 'true' }} + -Pdocumentation.replaceCurrentDocs=${{ contains(inputs.releaseVersion, '-') && 'false' || 'true' }} - name: Wait for deployment to GitHub Pages if: ${{ inputs.dryRun == false }} id: pagesDeployment timeout-minutes: 20 run: | - URL="https://junit.org/junit5/docs/${{ github.event.inputs.releaseVersion }}/user-guide/junit-user-guide-${{ github.event.inputs.releaseVersion }}.pdf" + URL="https://docs.junit.org/${{ inputs.releaseVersion }}/user-guide/junit-user-guide-${{ inputs.releaseVersion }}.pdf" ./.github/scripts/waitForUrl.sh "$URL" echo "pdfUrl=$URL" >> "$GITHUB_OUTPUT" - name: Verify integrity of PDF version of User Guide @@ -223,47 +232,27 @@ jobs: curl --silent --fail --location --output /tmp/junit-user-guide.pdf "${{ steps.pagesDeployment.outputs.pdfUrl }}" pdfinfo /tmp/junit-user-guide.pdf - wait_for_maven_central: - name: Wait for Maven Central + update_examples: + name: Update examples needs: publish_deployment runs-on: ubuntu-latest steps: - - name: Check out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - fetch-depth: 1 - ref: "refs/tags/${{ env.RELEASE_TAG }}" - - name: Download local Maven repository - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - with: - name: local-maven-repository - path: build/repo - - name: Wait for sync to Maven Central - if: ${{ inputs.dryRun == false }} - timeout-minutes: 30 - run: | - find build/repo -name '*.pom' -printf './.github/scripts/waitForMavenCentralSync.sh %P\n' | sh - - update_samples: - name: Update samples - needs: wait_for_maven_central - runs-on: ubuntu-latest - steps: - - name: Check out samples repository + - name: Check out examples repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: - repository: ${{ github.repository_owner }}/junit5-samples - token: ${{ secrets.GH_TOKEN }} + repository: ${{ github.repository_owner }}/junit-examples + token: ${{ secrets.JUNIT_BUILDS_GITHUB_TOKEN_EXAMPLES_REPO }} fetch-depth: 1 + ref: develop/6.x - name: Set up JDK uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 with: - java-version: 21 + java-version: 24 distribution: temurin - - uses: sbt/setup-sbt@26ab4b0fa1c47fa62fc1f6e51823a658fb6c760c # v1.1.7 - - name: Update JUnit dependencies in samples - run: java src/Updater.java ${{ github.event.inputs.releaseVersion }} - - name: Build samples + - uses: sbt/setup-sbt@234370af1319038bf8dc432f8a7e4b83078a1781 # v1.1.11 + - name: Update JUnit dependencies in examples + run: java src/Updater.java ${{ inputs.releaseVersion }} + - name: Build examples if: ${{ inputs.dryRun == false }} run: java src/Builder.java - name: Create release branch @@ -272,13 +261,13 @@ jobs: git config user.email "team@junit.org" git switch -c "${{ env.RELEASE_TAG }}" git status - git commit -a -m "Use ${{ github.event.inputs.releaseVersion }}" + git commit -a -m "Use ${{ inputs.releaseVersion }}" - name: Push release branch if: ${{ inputs.dryRun == false }} run: | git push origin "${{ env.RELEASE_TAG }}" - name: Update main branch (only for GA releases) - if: ${{ inputs.dryRun == false && !contains(github.event.inputs.releaseVersion, '-') }} + if: ${{ inputs.dryRun == false && !contains(inputs.releaseVersion, '-') }} run: | git switch main git merge --ff-only "${{ env.RELEASE_TAG }}" @@ -287,7 +276,7 @@ jobs: create_github_release: name: Create GitHub release if: ${{ inputs.dryRun == false }} - needs: wait_for_maven_central + needs: [ publish_documentation, update_examples ] runs-on: ubuntu-latest permissions: contents: write @@ -296,17 +285,14 @@ jobs: uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | - const releaseVersion = "${{ github.event.inputs.releaseVersion }}"; - const jupiterVersion = releaseVersion; - const vintageVersion = releaseVersion; - const platformVersion = "1." + releaseVersion.substring(2); + const releaseVersion = "${{ inputs.releaseVersion }}"; const requestBody = { owner: context.repo.owner, repo: context.repo.repo, tag_name: `r${releaseVersion}`, name: `JUnit ${releaseVersion}`, generate_release_notes: true, - body: `JUnit ${jupiterVersion} = Platform ${platformVersion} + Jupiter ${jupiterVersion} + Vintage ${vintageVersion}\n\nSee [Release Notes](https://junit.org/junit5/docs/${releaseVersion}/release-notes/).`, + body: `JUnit ${releaseVersion} = Platform ${releaseVersion} + Jupiter ${releaseVersion} + Vintage ${releaseVersion}\n\nSee [Release Notes](https://docs.junit.org/${releaseVersion}/release-notes/).`, prerelease: releaseVersion.includes("-"), }; console.log(requestBody); diff --git a/.github/workflows/reproducible-build.yml b/.github/workflows/reproducible-build.yml index 546ff5b9cd18..9b7fa596f125 100644 --- a/.github/workflows/reproducible-build.yml +++ b/.github/workflows/reproducible-build.yml @@ -9,7 +9,7 @@ on: branches: - '**' -permissions: read-all +permissions: {} env: DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} diff --git a/.github/workflows/sanitize-closed-issues.yml b/.github/workflows/sanitize-closed-issues.yml index 046be82f7804..ca77b2bd4f9d 100644 --- a/.github/workflows/sanitize-closed-issues.yml +++ b/.github/workflows/sanitize-closed-issues.yml @@ -3,7 +3,7 @@ on: issues: types: - closed -permissions: read-all +permissions: {} jobs: label_issues: runs-on: ubuntu-latest diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 9f10a217b5b9..da9a350c8e4c 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -7,6 +7,7 @@