Bump the maven-dependencies group across 1 directory with 4 updates #103
Workflow file for this run
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
| name: Build | |
| on: | |
| [push] | |
| env: | |
| JAVA_VERSION: 21 | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # Required for the attestations step | |
| contents: write # Required for the release step | |
| attestations: write # Required for the attestations step | |
| packages: write # Required for the deploy to GitHub Packages step | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: temurin | |
| cache: 'maven' | |
| server-id: central | |
| server-username: MAVEN_CENTRAL_USERNAME | |
| server-password: MAVEN_CENTRAL_PASSWORD | |
| gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} | |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
| - name: Cache SonarCloud packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Build and Test | |
| run: > | |
| mvn -B verify --no-transfer-progress | |
| jacoco:report | |
| org.sonarsource.scanner.maven:sonar-maven-plugin:sonar | |
| -Pcoverage | |
| -Dsonar.projectKey=coffeelibs_tiny-oauth2-client | |
| -Dsonar.organization=coffeelibs | |
| -Dsonar.host.url=https://sonarcloud.io | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| - name: Deploy to Maven Central | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: mvn -B deploy -Psign,deploy-central -DskipTests --no-transfer-progress | |
| env: | |
| MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }} | |
| MAVEN_GPG_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} | |
| MAVEN_GPG_KEY_FINGERPRINT: ${{ vars.RELEASES_GPG_KEY_FINGERPRINT }} | |
| - uses: actions/setup-java@v4 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: temurin | |
| cache: 'maven' | |
| - name: Deploy to GitHub Packages | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: mvn -B deploy -Psign,deploy-github -DskipTests --no-transfer-progress | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }} | |
| MAVEN_GPG_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} | |
| MAVEN_GPG_KEY_FINGERPRINT: ${{ vars.RELEASES_GPG_KEY_FINGERPRINT }} | |
| - name: Attest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: actions/attest-build-provenance@v2 | |
| with: | |
| subject-path: | | |
| target/tiny-oauth2-client-*.jar | |
| target/tiny-oauth2-client-*.pom | |
| - name: Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true |