test github actions #63
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: Java with Nexus Repository | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 1.16 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 16 | |
- name: Build with Maven | |
run: mvn package --file pom.xml | |
- name: Set Release version env variable | |
run: | | |
echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
echo "RELEASE_ARTIFACT=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)" >> $GITHUB_ENV | |
echo "RELEASE_GROUP=$(mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout)" >> $GITHUB_ENV | |
- name: Nexus Repo Publish | |
uses: sonatype-nexus-community/nexus-repo-github-action@master | |
with: | |
serverUrl: https://nexus.leonardbausenwein.de/ | |
username: admin | |
password: ${{ secrets.NEXUS_PASSWORD }} | |
format: maven2 | |
repository: maven-releases | |
coordinates: groupId=${{ env.RELEASE_GROUP }} artifactId=${{ env.RELEASE_ARTIFACT }} version=${{ env.RELEASE_VERSION }} | |
assets: extension=jar | |
filename: ./target/${{ env.RELEASE_ARTIFACT }}-${{ env.RELEASE_VERSION }}.jar | |
args: generate-pom=true packaging=jar |