Add sonarqube into readme #84
This file contains 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: | |
branches: | |
- master | |
jobs: | |
build: | |
# Run on all label events (won't be duplicated) or all push events or on PR syncs not from the same repo | |
if: github.repository_owner == 'OneLiteFeatherNET' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v3 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
cache: gradle | |
java-version: 21 | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Clean Build | |
run: ./gradlew build sonar --info | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: Publish to Central via Build | |
run: | | |
./gradlew publishToSonatype :testing:publishToSonatype closeAndReleaseSonatypeStagingRepository -PforceSign=true | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
GPG_PRIVATE_KEY: ${{ secrets.ONELITEFEATHER_GPG_KEY }} | |
GPG_PASSPHRASE: ${{ secrets.ONELITEFEATHER_GPG_PASSWORD }} | |
ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}" | |
ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}" | |
ORG_GRADLE_PROJECT_onelitefeatherSigningKey: "${{ secrets.ONELITEFEATHER_GPG_KEY }}" | |
ORG_GRADLE_PROJECT_onelitefeatherSigningPassword: "${{ secrets.ONELITEFEATHER_GPG_PASSWORD }}" | |
ORG_GRADLE_PROJECT_signingKey: "${{ secrets.ONELITEFEATHER_GPG_KEY }}" | |
ORG_GRADLE_PROJECT_signingPassword: "${{ secrets.ONELITEFEATHER_GPG_PASSWORD }}" | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |