1
- name : Snapshot release
1
+ name : Snapshot Release
2
2
3
3
on :
4
4
push :
7
7
tags-ignore :
8
8
- " *" # Ignore all tags
9
9
paths :
10
- - " **/*.java" # Trigger on any Java file change
11
- - " **/*.xml" # Trigger on any xml file change
12
- - " **/Dockerfile*" # Trigger on any Dockerfile change
13
- - " .github/workflows/*.yml" # Trigger on any workflow file change
10
+ - " **/*.java"
11
+ - " **/*.xml"
12
+ - " **/Dockerfile*"
13
+ - " **/pom.xml"
14
+ - " .github/workflows/*.yml"
14
15
15
16
jobs :
16
- # Build and test the project
17
17
build :
18
18
if : " !contains(github.event.head_commit.message, 'skip ci')"
19
19
runs-on : ubuntu-latest
20
20
strategy :
21
21
matrix :
22
- mongodb-version : ["5.0", "6.0", "7.0"]
22
+ mongodb-version : ["5.0", "6.0", "7.0", "8.0" ]
23
23
timeout-minutes : 5
24
24
steps :
25
25
- uses : actions/checkout@v4
26
-
27
26
- name : Set up JDK 21
28
27
uses : actions/setup-java@v4
29
28
with :
30
29
distribution : " temurin"
31
30
java-version : " 21"
32
31
cache : " maven"
33
-
34
32
- name : Build and Test
35
33
env :
36
34
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
37
35
run : mvn -B clean verify -Dmongodb.version="${{ matrix.mongodb-version }}"
36
+ - name : Upload build artifacts for Docker jobs (only for 8.0)
37
+ if : matrix.mongodb-version == '8.0'
38
+ uses : actions/upload-artifact@v4
39
+ with :
40
+ name : restheart-artifacts
41
+ path : |
42
+ core/target/restheart.jar
43
+ core/target/lib/*.jar
44
+ core/target/plugins/*.jar
45
+ core/target/plugins/lib/*.jar
38
46
39
- # Deploy the project to Maven Central and DockerHub
40
- deploy :
47
+ deploy-maven-central :
41
48
if : " !contains(github.event.head_commit.message, 'skip ci')"
49
+ needs : build
42
50
runs-on : ubuntu-latest
43
51
strategy :
44
52
matrix :
45
53
mongodb-version : ["8.0"]
46
- timeout-minutes : 15
47
54
steps :
48
55
- uses : actions/checkout@v4
49
-
50
56
- name : Set up JDK 21
51
57
uses : actions/setup-java@v4
52
58
with :
53
59
distribution : " temurin"
54
60
java-version : " 21"
55
61
cache : " maven"
56
-
57
- - name : Set SHA
58
- id : vars
59
- run : |
60
- echo "SHA=$(echo ${GITHUB_SHA:0:7})" >> $GITHUB_ENV
61
-
62
62
- name : Import private gpg key
63
63
run : |
64
64
printf "%s" "$GPG_PRIVATE_KEY" > private.key
65
65
gpg --pinentry-mode=loopback --batch --yes --fast-import private.key
66
66
env :
67
67
GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
68
-
69
- - name : Deploy to Maven Central
68
+ - name : Deploy to Maven Central (8.0 only)
70
69
run : |
71
70
MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED" \
72
71
mvn -B deploy -Pdeploy -Dmongodb.version="${{ matrix.mongodb-version }}" -s settings.xml
@@ -76,19 +75,33 @@ jobs:
76
75
GPG_KEY_NAME : ${{ secrets.GPG_KEY_NAME }}
77
76
GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
78
77
78
+ build-docker-standard :
79
+ if : " !contains(github.event.head_commit.message, 'skip ci')"
80
+ needs : build
81
+ runs-on : ubuntu-latest
82
+ strategy :
83
+ matrix :
84
+ mongodb-version : ["8.0"]
85
+ steps :
86
+ - uses : actions/checkout@v4
87
+ - name : Download build artifacts
88
+ uses : actions/download-artifact@v4
89
+ with :
90
+ name : restheart-artifacts
91
+ path : core/target/
92
+ - name : Set SHA
93
+ run : |
94
+ echo "SHA=$(echo ${GITHUB_SHA:0:7})" >> $GITHUB_ENV
79
95
- name : Set up QEMU
80
96
uses : docker/setup-qemu-action@v3
81
-
82
97
- name : Set up Docker Buildx
83
98
uses : docker/setup-buildx-action@v3
84
-
85
99
- name : Login to DockerHub
86
100
uses : docker/login-action@v3
87
101
with :
88
102
username : ${{ secrets.DOCKER_USER }}
89
103
password : ${{ secrets.DOCKER_TOKEN }}
90
-
91
- - name : Build and Push multi-arch Docker images
104
+ - name : Build and Push multi-arch Docker images (8.0 only)
92
105
uses : docker/build-push-action@v6
93
106
with :
94
107
context : ./core/
@@ -104,7 +117,33 @@ jobs:
104
117
softinstigate/restheart-snapshot:${{ env.SHA }},
105
118
${{ github.ref == 'refs/heads/master' && 'softinstigate/restheart-snapshot:latest' || '' }}
106
119
107
- - name : Build and Push GraalVM Docker image
120
+ build-docker-graalvm :
121
+ if : " !contains(github.event.head_commit.message, 'skip ci')"
122
+ needs : build
123
+ runs-on : ubuntu-latest
124
+ strategy :
125
+ matrix :
126
+ mongodb-version : ["8.0"]
127
+ steps :
128
+ - uses : actions/checkout@v4
129
+ - name : Download build artifacts
130
+ uses : actions/download-artifact@v4
131
+ with :
132
+ name : restheart-artifacts
133
+ path : core/target/
134
+ - name : Set SHA
135
+ run : |
136
+ echo "SHA=$(echo ${GITHUB_SHA:0:7})" >> $GITHUB_ENV
137
+ - name : Set up QEMU
138
+ uses : docker/setup-qemu-action@v3
139
+ - name : Set up Docker Buildx
140
+ uses : docker/setup-buildx-action@v3
141
+ - name : Login to DockerHub
142
+ uses : docker/login-action@v3
143
+ with :
144
+ username : ${{ secrets.DOCKER_USER }}
145
+ password : ${{ secrets.DOCKER_TOKEN }}
146
+ - name : Build and Push GraalVM Docker image (8.0 only)
108
147
uses : docker/build-push-action@v6
109
148
with :
110
149
context : ./core/
@@ -119,7 +158,33 @@ jobs:
119
158
softinstigate/restheart-snapshot:${{ env.SHA }}-graalvm,
120
159
${{ github.ref == 'refs/heads/master' && 'softinstigate/restheart-snapshot:latest-graalvm' || '' }}
121
160
122
- - name : Build and Push distroless docker image
161
+ build-docker-distroless :
162
+ if : " !contains(github.event.head_commit.message, 'skip ci')"
163
+ needs : build
164
+ runs-on : ubuntu-latest
165
+ strategy :
166
+ matrix :
167
+ mongodb-version : ["8.0"]
168
+ steps :
169
+ - uses : actions/checkout@v4
170
+ - name : Download build artifacts
171
+ uses : actions/download-artifact@v4
172
+ with :
173
+ name : restheart-artifacts
174
+ path : core/target/
175
+ - name : Set SHA
176
+ run : |
177
+ echo "SHA=$(echo ${GITHUB_SHA:0:7})" >> $GITHUB_ENV
178
+ - name : Set up QEMU
179
+ uses : docker/setup-qemu-action@v3
180
+ - name : Set up Docker Buildx
181
+ uses : docker/setup-buildx-action@v3
182
+ - name : Login to DockerHub
183
+ uses : docker/login-action@v3
184
+ with :
185
+ username : ${{ secrets.DOCKER_USER }}
186
+ password : ${{ secrets.DOCKER_TOKEN }}
187
+ - name : Build and Push distroless docker image (8.0 only)
123
188
uses : docker/build-push-action@v6
124
189
with :
125
190
context : ./core/
0 commit comments