-
Notifications
You must be signed in to change notification settings - Fork 15
55 lines (49 loc) · 1.48 KB
/
build.yml
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
name: Build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'oracle'
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
- name: Build project (macOS)
if: runner.os == 'macOS'
run: |
./mvnw -B -ntp verify -f rta
- name: Build project (Windows)
if: runner.os == 'Windows'
run: |
.\mvnw -B -ntp verify -f rta
- name: Build project (Linux)
if: runner.os == 'Linux'
run: |
export DISPLAY=:90
Xvfb -ac :90 -screen 0 1280x1024x24 > /dev/null 2>&1 &
./mvnw -B -ntp verify -f rta
- name: Publish Snapshots
if: github.ref == 'refs/heads/main' && runner.os == 'Linux'
run: |
ver=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout -f rta)
if [[ $ver == *"SNAPSHOT"* ]]; then
./mvnw -B -ntp -Dmaven.test.skip=true deploy -f rta
fi
shell: bash
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}