-
Notifications
You must be signed in to change notification settings - Fork 126
107 lines (89 loc) · 2.96 KB
/
maven.yml
File metadata and controls
107 lines (89 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Maven Build and Deployment
on:
push:
branches: [ master ]
tags: [ 'lmdbjava-*' ]
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@v5
- name: Set up Java and Maven
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 25
cache: maven
- name: Build with Maven
run: mvn -B verify -DgcRecordWrites=1000
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
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, 25]
steps:
- name: Check out Git repository
uses: actions/checkout@v5
- name: Set up Java and Maven
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: ${{ matrix.java }}
cache: maven
- name: Execute verifier
run: mvn -B test -Dtest=VerifierTest -DverificationSeconds=10
- name: Upload Surefire reports on test failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: surefire-test-log
path: target/surefire-reports
deploy:
name: Deploy to Central Portal
needs: [build, compatibility-checks]
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v5
- name: Set up Java and Maven
uses: actions/setup-java@v5
with:
distribution: zulu
# Java version 8 required due to https://github.com/lmdbjava/lmdbjava/issues/116
java-version: 8
cache: maven
server-id: central
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.gpg_private_key }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Get project version
id: version
run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
- name: Publish Maven package
if: |
(github.ref_type == 'branch' && contains(steps.version.outputs.version, '-SNAPSHOT')) ||
(github.ref_type == 'tag' && !contains(steps.version.outputs.version, '-SNAPSHOT'))
run: mvn -B -Pcentral-deploy deploy -DskipTests
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.gpg_passphrase }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.central_username }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.central_password }}
- name: Debug settings.xml
uses: actions/upload-artifact@v4
if: failure()
with:
name: settings.xml
path: ~/.m2/settings.xml