Merge pull request #223 from redlink-gmbh/dependabot/maven/org.apache… #151
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, Test & Publish | |
on: | |
push: | |
branches: | |
- "main" | |
- "maintenance/v*" | |
tags: | |
- "v*" | |
jobs: | |
version: | |
name: Determine Version | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout | |
with: | |
fetch-depth: 2 | |
- name: Set up Java/Maven | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
- name: Detect Version | |
id: version | |
run: ./mvnw -B -q -N exec:exec -Dexec.executable=echo -Dexec.args='version=${project.version}' -Dexec.outputFile="$GITHUB_OUTPUT" | |
build: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Java/Maven | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
- name: Compile & Test | |
run: ./mvnw -V -B --no-transfer-progress | |
clean | |
org.jacoco:jacoco-maven-plugin:prepare-agent | |
verify | |
org.jacoco:jacoco-maven-plugin:report | |
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar | |
-Dnominatim.email="${{ secrets.NOMINATIM_USER }}" | |
-Dgoogle.apiKey="${{ secrets.GOOGLE_API_KEY }}" | |
-Dsonar.skip=${{ github.actor == 'dependabot[bot]' }} | |
-Dsonar.organization=redlink | |
-Dsonar.host.url=https://sonarcloud.io | |
-Dsonar.projectKey=redlink-gmbh_redlink-geocoding | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: '**/TEST-*.xml' | |
deploy: | |
name: Publish | |
needs: | |
- version | |
- build | |
runs-on: ubuntu-latest | |
if: github.repository == 'redlink-gmbh/redlink-geocoding' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Java/Maven | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: 'maven' | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Compile & Test | |
run: ./mvnw -V -B --no-transfer-progress clean verify | |
- name: Publish Packages | |
run: ./mvnw -B --no-transfer-progress | |
package javadoc:aggregate-jar@aggregate deploy | |
-Prelease | |
-Dquick | |
-Ddocker.local.skip=true | |
-Ddocker.image.namespace=ghcr.io/${{ github.repository }} | |
-Ddocker.image.buildId=build${{ github.run_number }}_${GITHUB_SHA:0:7} | |
-Djib.to.auth.username=${{ github.actor }} | |
-Djib.to.auth.password=${{ secrets.GITHUB_TOKEN }} | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |