chore: update java 8 build to publish snapshots
@@ -8,6 +8,7 @@ on:
branches: [ develop, 3.1.x, 3.0.x ]
pull_request:
branches: [ develop, 3.1.x, 3.0.x ]
+ workflow_dispatch:
jobs:
build:
@@ -16,12 +17,23 @@ jobs:
steps:
- uses: actions/checkout@v2
- - name: Set up JDK 8
+ - name: Set up JDK 8 PR
+ if: github.event_name == 'pull_request'
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
# Step that does that actual cache save and restore
+ - name: Set up JDK 8 Branch
+ if: github.event_name != 'pull_request'
+ uses: actions/setup-java@v2
+ with:
+ java-version: '8'
+ distribution: 'adopt'
+ server-id: sonatype-nexus-snapshots
+ server-username: MAVEN_USERNAME
+ server-password: MAVEN_PASSWORD
+ # Step that does that actual cache save and restore
- name: Cache
uses: actions/cache@v1
with:
@@ -31,3 +43,9 @@ jobs:
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B package --file pom.xml
+ - name: Publish Snapshot
+ if: github.event_name != 'pull_request'
+ run: mvn -B deploy -DskipTests --file pom.xml
+ env:
+ MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
+ MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
