-
Notifications
You must be signed in to change notification settings - Fork 10
95 lines (82 loc) · 2.77 KB
/
ci.yml
File metadata and controls
95 lines (82 loc) · 2.77 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
name: CI
on:
push:
branches:
- master
- '[0-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[0-9]+.[0-9]+.x'
schedule:
- cron: '0 18 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
MAVEN_OPTS: '-Xmx4G -Xms1G -Djava.security.egd=file:/dev/./urandom'
MAVEN_CLI_OPTS: '-B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
jobs:
incremental-build:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build
run: mvn clean install $MAVEN_CLI_OPTS -DskipTests -pl '!docker'
full-build:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build
run: mvn clean install $MAVEN_CLI_OPTS -DskipTests -pl '!docker'
deploy:
needs: full-build
if: |
github.event_name != 'pull_request' &&
(github.ref == 'refs/heads/master' || contains(github.ref, '.x'))
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Create Maven Settings
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: |
mkdir -p ~/.m2
printf '<settings>\n <servers>\n <server>\n <id>releases</id>\n <username>%s</username>\n <password>%s</password>\n </server>\n <server>\n <id>snapshots</id>\n <username>%s</username>\n <password>%s</password>\n </server>\n </servers>\n</settings>\n' "$NEXUS_USERNAME" "$NEXUS_PASSWORD" "$NEXUS_USERNAME" "$NEXUS_PASSWORD" > ~/.m2/settings.xml
- name: Deploy
run: |
mvn deploy $MAVEN_CLI_OPTS \
-DskipTests=true \
-DretryFailedDeploymentCount=10 \
-pl '!docker' \
-DaltReleaseDeploymentRepository=releases::https://repo.codice.org/repository/maven-releases/ \
-DaltSnapshotDeploymentRepository=snapshots::https://repo.codice.org/repository/maven-snapshots/