Skip to content

Commit 6f43bf8

Browse files
committed
feat: update CI workflows to support MongoDB version 8.0 and adjust artifact upload conditions
1 parent 06a7e6f commit 6f43bf8

File tree

2 files changed

+20
-26
lines changed

2 files changed

+20
-26
lines changed

.github/workflows/branch.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,25 @@ on:
1414
- ".github/workflows/*.yml"
1515

1616
jobs:
17-
# Build and test the project
1817
build:
1918
if: "!contains(github.event.head_commit.message, 'skip ci')"
2019
runs-on: ubuntu-24.04
2120
strategy:
2221
matrix:
23-
mongodb-version: ["5.0", "6.0", "7.0"]
22+
mongodb-version: ["5.0", "6.0", "7.0", "8.0"]
2423
timeout-minutes: 5
2524
steps:
2625
- uses: actions/checkout@v4
27-
2826
- name: Set up JDK 21
2927
uses: actions/setup-java@v4
3028
with:
3129
distribution: "temurin"
3230
java-version: "21"
3331
cache: "maven"
34-
3532
- name: Build and Test
3633
run: mvn -B clean verify -Dmongodb.version="${{ matrix.mongodb-version }}"
37-
38-
- name: Upload build artifacts for Docker jobs
34+
- name: Upload build artifacts for Docker jobs (only for 8.0)
35+
if: matrix.mongodb-version == '8.0'
3936
uses: actions/upload-artifact@v4
4037
with:
4138
name: restheart-artifacts
@@ -52,7 +49,6 @@ jobs:
5249
strategy:
5350
matrix:
5451
mongodb-version: ["8.0"]
55-
timeout-minutes: 20
5652
steps:
5753
- uses: actions/checkout@v4
5854
- name: Set up JDK 21
@@ -67,7 +63,7 @@ jobs:
6763
gpg --pinentry-mode=loopback --batch --yes --fast-import private.key
6864
env:
6965
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
70-
- name: Deploy to Maven Central
66+
- name: Deploy to Maven Central (8.0 only)
7167
run: |
7268
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" \
7369
mvn -B deploy -Pdeploy -Dmongodb.version="${{ matrix.mongodb-version }}" -s settings.xml
@@ -84,7 +80,6 @@ jobs:
8480
strategy:
8581
matrix:
8682
mongodb-version: ["8.0"]
87-
timeout-minutes: 10
8883
steps:
8984
- uses: actions/checkout@v4
9085
- name: Download build artifacts
@@ -104,7 +99,7 @@ jobs:
10499
with:
105100
username: ${{ secrets.DOCKER_USER }}
106101
password: ${{ secrets.DOCKER_TOKEN }}
107-
- name: Build and Push multi-arch Docker images
102+
- name: Build and Push multi-arch Docker images (8.0 only)
108103
uses: docker/build-push-action@v6
109104
with:
110105
context: ./core/
@@ -126,7 +121,6 @@ jobs:
126121
strategy:
127122
matrix:
128123
mongodb-version: ["8.0"]
129-
timeout-minutes: 10
130124
steps:
131125
- uses: actions/checkout@v4
132126
- name: Download build artifacts
@@ -146,7 +140,7 @@ jobs:
146140
with:
147141
username: ${{ secrets.DOCKER_USER }}
148142
password: ${{ secrets.DOCKER_TOKEN }}
149-
- name: Build and Push GraalVM Docker image
143+
- name: Build and Push GraalVM Docker image (8.0 only)
150144
uses: docker/build-push-action@v6
151145
with:
152146
context: ./core/
@@ -161,13 +155,12 @@ jobs:
161155
${{ github.ref == 'refs/heads/master' && 'softinstigate/restheart-snapshot:latest-graalvm' || '' }}
162156
163157
build-docker-distroless:
164-
if: "!contains(github.event.head_commit.message, 'skip ci')"
158+
if: "!contains(github.event.head_commit.message, 'skip ci') && matrix.mongodb-version == '8.0'"
165159
needs: build
166160
runs-on: ubuntu-22.04
167161
strategy:
168162
matrix:
169163
mongodb-version: ["8.0"]
170-
timeout-minutes: 10
171164
steps:
172165
- uses: actions/checkout@v4
173166
- name: Download build artifacts
@@ -187,7 +180,7 @@ jobs:
187180
with:
188181
username: ${{ secrets.DOCKER_USER }}
189182
password: ${{ secrets.DOCKER_TOKEN }}
190-
- name: Build and Push distroless docker image
183+
- name: Build and Push distroless docker image (8.0 only)
191184
uses: docker/build-push-action@v6
192185
with:
193186
context: ./core/

.github/workflows/tags.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
mongodb-version: ["5.0", "6.0", "7.0"]
17+
mongodb-version: ["5.0", "6.0", "7.0", "8.0"]
1818
timeout-minutes: 10
1919
steps:
2020
- uses: actions/checkout@v4
@@ -30,6 +30,17 @@ jobs:
3030
run: |
3131
mvn -B clean verify -Dmongodb.version="${{ matrix.mongodb-version }}"
3232
33+
- name: Upload build artifacts for Docker jobs
34+
if: matrix.mongodb-version == '8.0'
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: restheart-artifacts
38+
path: |
39+
core/target/restheart.jar
40+
core/target/lib/*.jar
41+
core/target/plugins/*.jar
42+
core/target/plugins/lib/*.jar
43+
3344
# Release the project on GitHub
3445
release:
3546
if: "!contains(github.event.head_commit.message, 'skip ci')"
@@ -86,16 +97,6 @@ jobs:
8697
draft: true
8798
prerelease: false
8899

89-
- name: Upload build artifacts for Docker jobs
90-
uses: actions/upload-artifact@v4
91-
with:
92-
name: restheart-artifacts
93-
path: |
94-
core/target/restheart.jar
95-
core/target/lib/*.jar
96-
core/target/plugins/*.jar
97-
core/target/plugins/lib/*.jar
98-
99100
build-docker-standard:
100101
if: "!contains(github.event.head_commit.message, 'skip ci')"
101102
needs: build

0 commit comments

Comments
 (0)