Merge pull request #88 from adlange/dependabot/maven/org.codehaus.gma… #168
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 and Publish | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.JRELEASER_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: version | |
run: echo ::set-output name=version::$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout) | |
id: version | |
- name: Verify Build | |
run: ./mvnw --batch-mode --no-transfer-progress clean verify | |
- if: startsWith(github.event.ref, 'refs/tags/v') | |
name: Publish package | |
run: ./mvnw --batch-mode --no-transfer-progress clean deploy -DskipTests=true -Prelease | |
env: | |
MAVEN_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} | |
- if: startsWith(github.event.ref, 'refs/tags/v') && !endsWith(steps.version.outputs.version, '-SNAPSHOT') | |
name: Create Release | |
uses: actions/create-release@v1 | |
id: create_release | |
with: | |
draft: false | |
prerelease: false | |
release_name: ${{ steps.version.outputs.version }} | |
tag_name: ${{ github.ref }} | |
body: | | |
Grab the new version from Maven central https://repo1.maven.org/maven2/de/adrianlange/mailserver-configuration-discovery/${{ steps.version.outputs.version }}/ by using it in your dependencies: | |
```xml | |
<dependency> | |
<groupId>de.adrianlange</groupId> | |
<artifactId>mailserver-configuration-discovery</artifactId> | |
<version>${{ steps.version.outputs.version }}</version> | |
</dependency> | |
``` | |
Or using Gradle: | |
```groovy | |
implementation( 'de.adrianlange:mailserver-configuration-discovery:${{ steps.version.outputs.version }}' ) | |
``` | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |