-
Notifications
You must be signed in to change notification settings - Fork 10
147 lines (132 loc) · 3.95 KB
/
ci.yml
File metadata and controls
147 lines (132 loc) · 3.95 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
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: Configure Maven settings
uses: s4u/maven-settings-action@v3.0.0
with:
servers: |
[{
"id": "github",
"username": "${{ github.actor }}",
"password": "${{ secrets.GITHUB_TOKEN }}"
}]
repositories: |
[{
"id": "github",
"url": "https://maven.pkg.github.com/codice/*",
"snapshots": {"enabled": true}
}]
- 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: Configure Maven settings
uses: s4u/maven-settings-action@v3.0.0
with:
servers: |
[{
"id": "github",
"username": "${{ github.actor }}",
"password": "${{ secrets.GITHUB_TOKEN }}"
}]
repositories: |
[{
"id": "github",
"url": "https://maven.pkg.github.com/codice/*",
"snapshots": {"enabled": true}
}]
- 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
permissions:
packages: write
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: Configure Maven settings
uses: s4u/maven-settings-action@v3.0.0
with:
servers: |
[{
"id": "releases",
"username": "${{ github.actor }}",
"password": "${{ secrets.GITHUB_TOKEN }}"
},
{
"id": "snapshots",
"username": "${{ github.actor }}",
"password": "${{ secrets.GITHUB_TOKEN }}"
},
{
"id": "github",
"username": "${{ github.actor }}",
"password": "${{ secrets.GITHUB_TOKEN }}"
}]
repositories: |
[{
"id": "github",
"url": "https://maven.pkg.github.com/codice/*",
"snapshots": {"enabled": true}
}]
- name: Deploy
run: |
mvn deploy $MAVEN_CLI_OPTS \
-DskipTests=true \
-DretryFailedDeploymentCount=10 \
-pl '!docker' \
-DaltReleaseDeploymentRepository=releases::https://maven.pkg.github.com/codice/acdebugger \
-DaltSnapshotDeploymentRepository=snapshots::https://maven.pkg.github.com/codice/acdebugger