diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cd875fa..c0be93a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,10 +17,10 @@ jobs: with: java-version: '21' distribution: 'temurin' #Eclipse Temurin - - name: Scan project + - name: Build and scan source code env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn --batch-mode --no-transfer-progress verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=oneteme_${{ github.event.repository.name }} + run: mvn --batch-mode --no-transfer-progress verify org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121:sonar -Dsonar.projectKey=${{ github.repository_owner }}_${{ github.event.repository.name }} - name: Extract project version id: mvnVer run: echo "version=$(mvn help:evaluate -DforceStdout -Dexpression=project.version -q)" >>$GITHUB_OUTPUT @@ -45,4 +45,4 @@ jobs: env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - run: mvn --batch-mode --quiet clean deploy \ No newline at end of file + run: mvn --batch-mode --no-transfer-progress clean deploy \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 082515b..70ed2ce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,24 +1,12 @@ name: tag release on: workflow_dispatch jobs: - scan: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'temurin' #Eclipse Temurin - - name: verify - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn --batch-mode --no-transfer-progress verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=oneteme_${{ github.event.repository.name }} deploy: - needs: scan runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - uses: actions/setup-java@v4 with: java-version: '21' @@ -32,7 +20,7 @@ jobs: MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} MAVEN_GPG_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} #signer=bc MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - run: mvn --no-transfer-progress --batch-mode -Pdeploy clean deploy + run: mvn --batch-mode --no-transfer-progress -Pdeploy clean deploy org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121:sonar -Dsonar.projectKey=${{ github.repository_owner }}_${{ github.event.repository.name }} - name: extract version id: mvnVer run: echo "version=$(mvn help:evaluate -DforceStdout -Dexpression=project.version -q)" >>$GITHUB_OUTPUT