-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 2.29 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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 }}