Add 'Reformat with scalafmt 3.11.4' to .git-blame-ignore-revs #530
This file contains hidden or 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
| # | |
| # CI build that assembles artifacts and runs tests. | |
| # If validation is successful this workflow releases from the main dev branch. | |
| # | |
| # - skipping CI: add [skip ci] to the commit message | |
| # - skipping release: add [skip release] to the commit message | |
| # | |
| name: CI | |
| on: | |
| push: | |
| branches: ['release/2.x'] | |
| tags: [v*] | |
| pull_request: | |
| branches: ['**'] | |
| permissions: | |
| contents: read | |
| jobs: | |
| # | |
| # Main build job | |
| # | |
| build: | |
| runs-on: ubuntu-latest | |
| if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" | |
| # Definition of the build matrix | |
| strategy: | |
| matrix: | |
| java: [11, 17, 21] | |
| # All build steps | |
| # SINGLE-MATRIX-JOB means that the step does not need to be executed on every job in the matrix | |
| steps: | |
| - name: 1. Check out code | |
| uses: actions/checkout@v2 # https://github.com/actions/checkout | |
| - name: 2. Set up Java ${{ matrix.java }} | |
| uses: actions/setup-java@v2 | |
| with: | |
| distribution: 'zulu' | |
| java-version: ${{ matrix.java }} | |
| - name: 3. Build on Java ${{ matrix.java }} | |
| run: ./build.sh | |
| verify-wrapper: | |
| name: "Verify Gradle wrapper" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: gradle/actions/wrapper-validation@v4 | |
| # | |
| # Release job, only for pushes to the main development branch | |
| # | |
| release: | |
| permissions: | |
| contents: write | |
| pull-requests: read | |
| issues: read | |
| runs-on: ubuntu-latest | |
| needs: [build] # build job must pass before we can release | |
| if: github.event_name == 'push' | |
| && (github.ref == 'refs/heads/release/2.x' || startsWith(github.ref, 'refs/tags/v')) | |
| && github.repository == 'mockito/mockito-scala' | |
| && !contains(toJSON(github.event.commits.*.message), '[skip release]') | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v2 # https://github.com/actions/checkout | |
| with: | |
| fetch-depth: '0' # https://github.com/shipkit/shipkit-changelog#fetch-depth-on-ci | |
| - name: Set up Java 17 | |
| uses: actions/setup-java@v2 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 17 | |
| - name: Build and publish to Maven Central | |
| run: ./gradlew writeActualVersion | |
| && export PROJECT_VERSION=`cat version.actual` | |
| && ./build.sh | |
| && ./gradlew publishToSonatype closeAndReleaseStagingRepositories | |
| env: | |
| NEXUS_TOKEN_USER: ${{secrets.NEXUS_TOKEN_USER}} | |
| NEXUS_TOKEN_PWD: ${{secrets.NEXUS_TOKEN_PWD}} | |
| PGP_KEY: ${{secrets.PGP_KEY}} | |
| PGP_PWD: ${{secrets.PGP_PWD}} | |
| # Changelog / GitHub release is best-effort: it must never fail the release once the | |
| # artifacts are already published to Maven Central. The GitHub release can be edited manually. | |
| - name: Create GitHub release with changelog | |
| continue-on-error: true | |
| run: ./gradlew githubRelease releaseSummary | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |