47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
name: Test and Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- 2.[0-9]+
|
|
|
|
jobs:
|
|
test:
|
|
name: Java ${{ matrix.java }} Test
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
java: [ 8, 11 ]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Setup java
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: ${{ matrix.java }}
|
|
- run: |
|
|
mvn clean install -DskipTests -B
|
|
mvn verify -B
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
name: Deploy
|
|
needs: test
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Setup java
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: 8
|
|
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
|
|
server-username: MAVEN_USERNAME # env variable for username in deploy
|
|
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
|
|
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
|
|
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
|
|
- name: Publish to Apache Maven Central
|
|
run: mvn clean deploy -Drelease -DskipTests -B
|
|
env:
|
|
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
|
|
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
|
|
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
|
|
|