Skip to content

rename sonar.login to sonar.token #59

rename sonar.login to sonar.token

rename sonar.login to sonar.token #59

Workflow file for this run

# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: Build and Deploy
on:
push:
branches:
- master
pull_request:
branches:
- master
paths-ignore:
- README.md
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
packages: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
server-id: github
- name: Build with Maven
if: success() && github.event_name == 'pull_request'
run: mvn -B verify
- name: Publish and Check
if: success() && github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
run: |
git config --global user.name "Github Actions"
git config --global user.email "maddingo@github.com"
mvn -B clean deploy -Pgithub,sonar -Dsonar.token=${{ secrets.SONARQUBE_TOKEN }}
mvn -B site site:stage scm-publish:publish-scm
env:
GITHUB_TOKEN: ${{ github.token }}
# - name: Set up JDK 17
# uses: actions/setup-java@v3
# with:
# java-version: '17'
# distribution: 'temurin'
# cache: 'maven'
# server-id: sonatype-nexus-snapshots
# server-username: SONATYPE_USERNAME
# server-password: SONATYPE_PASSWORD
# gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
# gpg-passphrase: SONATYPE_GPG_PASSPHRASE
# settings-path: ${{ github.workspace }} # location for the settings.xml file
# - name: Publish to Sonatype OSS
# run: mvn deploy
# env:
# MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
# SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
# SONATYPE_GPG_PASSPHRASE: ${{ secrets.SONATYPE_GPG_PASSPHRASE }}