[maven-release-plugin] prepare for next development iteration #1
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: Maven Build and Deployment | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
name: Latest Java LTS Build and Verify | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- name: Set up Java and Maven | |
uses: actions/setup-java@v3 | |
with: | |
distribution: zulu | |
java-version: 21 | |
cache: maven | |
- name: Install Zig | |
uses: goto-bus-stop/setup-zig@v2 | |
- name: Cross compile using Zig | |
run: ./cross-compile.sh | |
- name: Build with Maven | |
run: mvn -B verify -DgcRecordWrites=1000 | |
- name: Store built native libraries for later jobs | |
uses: actions/upload-artifact@v3 | |
with: | |
name: native-libraries | |
path: | | |
src/main/resources/org/lmdbjava/*.so | |
src/main/resources/org/lmdbjava/*.dll | |
- name: Upload code coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
compatibility-checks: | |
name: Java ${{ matrix.java }} on ${{ matrix.os }} Compatibility | |
needs: [build] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
java: [8, 11, 17, 21] | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- name: Set up Java and Maven | |
uses: actions/setup-java@v3 | |
with: | |
distribution: zulu | |
java-version: ${{ matrix.java }} | |
cache: maven | |
- name: Fetch built native libraries | |
uses: actions/download-artifact@v3 | |
with: | |
name: native-libraries | |
path: src/main/resources/org/lmdbjava | |
- name: Execute verifier | |
run: mvn -B test -Dtest=VerifierTest -DverificationSeconds=10 | |
- name: Upload Surefire reports on test failure | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: surefire-test-log | |
path: target/surefire-reports | |
deploy: | |
name: Deploy to OSSRH | |
needs: [build, compatibility-checks] | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- name: Set up Java and Maven | |
uses: actions/setup-java@v3 | |
with: | |
distribution: zulu | |
# Java version 8 required due to https://github.com/lmdbjava/lmdbjava/issues/116 | |
java-version: 8 | |
cache: maven | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_CENTRAL_TOKEN | |
gpg-private-key: ${{ secrets.gpg_private_key }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Install Zig | |
uses: goto-bus-stop/setup-zig@v2 | |
- name: Cross compile using Zig | |
run: ./cross-compile.sh | |
- name: Publish Maven package | |
run: mvn -B -Possrh-deploy deploy -DskipTests | |
env: | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.gpg_passphrase }} | |
MAVEN_USERNAME: ${{ secrets.nexus_username }} | |
MAVEN_CENTRAL_TOKEN: ${{ secrets.nexus_password }} | |
- name: Debug settings.xml | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: settings.xml | |
path: $HOME/.m2/settings.xml |