-
-
Notifications
You must be signed in to change notification settings - Fork 11
51 lines (41 loc) · 1.47 KB
/
Copy pathrelease.yaml
File metadata and controls
51 lines (41 loc) · 1.47 KB
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
name: Release to Maven Central
on:
push:
tags:
- 'v*.*.*'
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
cache: 'maven'
distribution: 'adopt'
- name: Configure Maven settings
run: |
mkdir -p $HOME/.m2
echo "<settings><servers><server><id>ossrh</id><username>${{ secrets.SONATYPE_USERNAME }}</username><password>${{ secrets.SONATYPE_PASSWORD }}</password></server></servers></settings>" > $HOME/.m2/settings.xml
- name: Basic plugin version verification
run: java -ea scripts/CheckPomVersions.java
- name: Build and Test
run: mvn --batch-mode --update-snapshots clean test spotless:check ossindex:audit
- name: Deploy to Maven Central
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_GPG_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
if: success()
run: MAVEN_GPG_PASSPHRASE=$MAVEN_GPG_PASSPHRASE MAVEN_GPG_KEY=${MAVEN_GPG_KEY} mvn deploy -DskipTests
- name: Create GitHub Release
if: success()
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}