Skip to content

no-op to test CI

no-op to test CI #14

name: Snapshot to Maven Central Repository
on:
push:
branches:
- master
- debug-ci
env:
# Some forks are using older Java versions, so we need to maintain backward compatibility
# or people's builds break, as the Maven Central version takes priority over local_lib
# (not present anymore as of DV 6.0, but relevant for prior versions!). Result: hard code to Java 8.
TARGET_JAVA_VERSION: 8
jobs:
publish:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[maven-release-plugin]') }}
strategy:
matrix:
java: [17]
steps:
- uses: actions/checkout@v3
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build, test, verify and publish snapshot
run: mvn -B verify -Djdk.version=${{ env.TARGET_JAVA_VERSION }}
- name: Publish snapshot
if: ${{ matrix.java == '17' }}
run: mvn -e -X deploy -DskipUT -DskipIT -Djdk.version=${{ env.TARGET_JAVA_VERSION }}
env:
MAVEN_USERNAME: ${{ secrets.DATAVERSEBOT_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.DATAVERSEBOT_SONATYPE_TOKEN }}