-
Notifications
You must be signed in to change notification settings - Fork 3
78 lines (67 loc) · 2.34 KB
/
build.yaml
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
name: Build and Deploy
on:
push:
branches:
- main
tags:
- 'v[0-9]+.*'
pull_request:
branches:
- main
env:
MAVEN_OPTS: "-Xmx4G -Dhttps.protocols=TLSv1.2 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
jobs:
builds:
if: ${{ !(github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, '[maven-release-plugin]')) }}
runs-on: buildjet-2vcpu-ubuntu-2204
needs: [tests]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
cache: 'maven'
- name: Compile
run: mvn -B install
- name: Test
run: mvn -B verify -Prun-its
- name: Attach artifact
id: build-artifact
uses: SWAT-engineering/maven-full-artifacts-action@v1
- name: Prepare Draft Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: ${{ steps.build-artifact.outputs.artifact-root-dir}}/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy
if: startsWith(github.ref, 'refs/tags/v')
uses: usethesource/releases-maven-action@v1
with:
maven-username: ${{ secrets.RELEASE_MAVEN_USERNAME }}
maven-password: ${{ secrets.RELEASE_MAVEN_PASSWORD }}
maven-local-port: ${{ secrets.RELEASE_MAVEN_LOCAL_PORT }}
ssh-hostname: ${{ secrets.RELEASE_SSH_SERVER }}
ssh-known-host: ${{ secrets.RELEASE_SSH_KNOWN_HOSTS }}
ssh-username: ${{ secrets.RELEASE_SSH_USERNAME }}
ssh-private-key: ${{ secrets.RELEASE_SSH_PRIVATE_KEY }}
tests:
if: ${{ !(github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, '[maven-release-plugin]')) }}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [buildjet-2vcpu-ubuntu-2204, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
cache: 'maven'
- name: Compile
run: mvn -B install
- name: Test
run: mvn -B verify -Prun-its