diff --git a/.github/workflows/build_maven_compatibility.yml b/.github/workflows/build_maven_compatibility.yml index e6c731d..7507e12 100644 --- a/.github/workflows/build_maven_compatibility.yml +++ b/.github/workflows/build_maven_compatibility.yml @@ -1,10 +1,8 @@ -# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. +# CI maven compatibility check +# +# version 1.0.0 +# +# see : https://universe.fugerit.org/src/docs/conventions/workflows/build_maven_compatibility.html name: CI maven compatibility check @@ -13,7 +11,7 @@ on: # a pull request. push: branches: - - develop + - branch-compatibility jobs: check-main: @@ -21,13 +19,13 @@ jobs: strategy: matrix: distribution: [ 'corretto' ] - java: [ '11', '17' ] + java: [ '11', '17', '21' ] os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ] name: Java ${{ matrix.os }} ${{ matrix.java }} (${{ matrix.distribution }}) compatibility check steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@main - name: Setup java - uses: actions/setup-java@v3 + uses: actions/setup-java@main with: distribution: ${{ matrix.distribution }} java-version: ${{ matrix.java }} @@ -42,9 +40,9 @@ jobs: os: [ 'ubuntu-latest' ] name: Java ${{ matrix.os }} ${{ matrix.java }} (${{ matrix.distribution }}) compatibility check steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@main - name: Setup java - uses: actions/setup-java@v3 + uses: actions/setup-java@main with: distribution: ${{ matrix.distribution }} java-version: ${{ matrix.java }} @@ -55,13 +53,13 @@ jobs: strategy: matrix: distribution: [ 'microsoft' ] - java: [ '11', '17' ] + java: [ '17' ] os: [ 'windows-latest' ] name: Java ${{ matrix.os }} ${{ matrix.java }} (${{ matrix.distribution }}) compatibility check steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@main - name: Setup java - uses: actions/setup-java@v3 + uses: actions/setup-java@main with: distribution: ${{ matrix.distribution }} java-version: ${{ matrix.java }} diff --git a/.github/workflows/build_maven_package.yml b/.github/workflows/build_maven_package.yml index 40363ad..1e4da87 100644 --- a/.github/workflows/build_maven_package.yml +++ b/.github/workflows/build_maven_package.yml @@ -1,12 +1,10 @@ -# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven +# CI with maven build and scan +# +# version 1.0.0 +# +# see : https://universe.fugerit.org/src/docs/conventions/workflows/build_maven_package.html -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: CI maven build and sonar cloud scan +name: CI maven build and scan on: # Trigger analysis when pushing in master or pull requests, and when creating @@ -14,7 +12,8 @@ on: push: branches: - main - - branch-sonarcloud + - develop + - branch-preview pull_request: types: - opened @@ -26,24 +25,24 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@main with: # Shallow clones should be disabled for a better relevancy of analysis fetch-depth: 0 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@main with: java-version: '17' distribution: 'corretto' cache: 'maven' - name: Cache Maven packages - uses: actions/cache@v1 + uses: actions/cache@main with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - name: Cache SonarCloud packages - uses: actions/cache@v1 + uses: actions/cache@main with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar @@ -56,13 +55,13 @@ jobs: # SonarCloud access token should be generated from https://sonarcloud.io/account/security/ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - name: Build and analyze - run: mvn -B clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Pcoverage,full,metadata,sonarfugerit -Dsonar.projectKey=fugerit-org_${{github.event.repository.name}} + run: mvn -B clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Pcoverage,full,metadata,sonarfugerit,buildreact -Dsonar.projectKey=fugerit-org_${{github.event.repository.name}} env: # Needed to get some information about the pull request, if any GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # SonarCloud access token should be generated from https://sonarcloud.io/account/security/ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive + # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive - name: Update dependency graph - uses: advanced-security/maven-dependency-submission-action@v3.0.2 \ No newline at end of file + uses: advanced-security/maven-dependency-submission-action@main \ No newline at end of file diff --git a/.github/workflows/deploy_maven_package.yml b/.github/workflows/deploy_maven_package.yml index c93f8f1..1ad1c87 100644 --- a/.github/workflows/deploy_maven_package.yml +++ b/.github/workflows/deploy_maven_package.yml @@ -1,17 +1,15 @@ -# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. +# CI deploy maven package +# +# version 1.0.0 +# +# see : https://universe.fugerit.org/src/docs/conventions/workflows/deploy_maven_package.html name: CI deploy maven package on: push: branches: - - deploy + - branch-deploy jobs: build: @@ -19,18 +17,18 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - uses: actions/checkout@main + - name: Set up JDK 17 + uses: actions/setup-java@main with: - java-version: '11' + java-version: '17' distribution: 'corretto' cache: maven - - name: Release Maven package - uses: samuelmeuli/action-maven-publish@v1 - with: - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg_passphrase: ${{ secrets.PASSPHRASE }} - nexus_username: ${{ secrets.OSS_USERNAME }} - nexus_password: ${{ secrets.OSS_PASSWORD }} - maven_args: -P doRelease + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Publish package + run: mvn --batch-mode deploy -P full,coverage,metadata + env: + MAVEN_USERNAME: ${{ secrets.OSS_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSS_PASSWORD }} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index bfd1420..43c5131 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- review github workflows +- fugert org project conventions badge + ## [1.5.2] - 2023-12-22 ### Changed diff --git a/README.md b/README.md index 770ce79..ec46a53 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,4 @@ Main parent pom of fugerit-org projects. [![Java runtime version](https://img.shields.io/badge/run%20on-java%208+-%23113366.svg?style=for-the-badge&logo=openjdk&logoColor=white)](https://universe.fugerit.org/src/docs/versions/java11.html) [![Java build version](https://img.shields.io/badge/build%20on-java%2011+-%23ED8B00.svg?style=for-the-badge&logo=openjdk&logoColor=white)](https://universe.fugerit.org/src/docs/versions/java11.html) [![Apache Maven](https://img.shields.io/badge/Apache%20Maven-3.9.0+-C71A36?style=for-the-badge&logo=Apache%20Maven&logoColor=white)](https://universe.fugerit.org/src/docs/versions/maven3_9.html) +[![Fugerit Github Project Conventions](https://img.shields.io/badge/Fugerit%20Org-Project%20Conventions-1A36C7?style=for-the-badge&logo=Onlinect%20Playground&logoColor=white)](https://universe.fugerit.org/src/docs/conventions/index.html)