mvn formatter:format #123
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cross-Platform Java Build | |
on: push | |
jobs: | |
# | |
# build the java application using | |
# cross-platform libs in openssl4j-objects | |
# from github repo | |
# | |
build_crossplatform_jar: | |
strategy: | |
matrix: | |
include: | |
- BUILD_JDK: 8 | |
- BUILD_JDK: 11 | |
- BUILD_JDK: 17 | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: ${{ matrix.BUILD_JDK }} | |
- | |
name: Cache local Maven repository | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- | |
name: Build with Maven | |
env: | |
GITHUB_USER: ${{ secrets.GH_USER }} | |
GITHUB_PASSWORD: ${{ secrets.GH_PASSWORD }} | |
run: mvn -B package --file pom.xml -s .github/settings.xml | |
- | |
name: Archive Test Results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: target-${{ matrix.BUILD_JDK }} | |
path: openssl4j/target | |
- | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-${{ matrix.BUILD_JDK }} | |
path: openssl4j/target/*.jar | |
- | |
name: Deploy with Maven to SONATYPE OSS Snapshot if secrets are set | |
env: | |
SONATYPE_USER: ${{ secrets.SONATYPE_USER }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
run: | | |
if [ "${SONATYPE_USER}" != "" -a "${SONATYPE_PASSWORD}" != "" ]; then | |
mvn -B deploy -P snapshot -s .github/settings.xml | |
else | |
echo "Not deploying, secrets SONATYPE_USER and SONATYPE_PASSWORD not provided" | |
fi |