Skip to content

Commit 8baf191

Browse files
cyip10acarbonetto
authored andcommitted
Java: Create Workflow to deploy artifacts for all platforms mentioned in build.matrix.json (valkey-io#2285)
Signed-off-by: Chloe Yip <chloe.yip@improving.com>
1 parent be0bf3d commit 8baf191

File tree

3 files changed

+46
-11
lines changed

3 files changed

+46
-11
lines changed

.github/workflows/java-cd.yml

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,25 @@ jobs:
211211
echo "Deployment ${{ env.DEPLOYMENT_ID }} was unsuccessful with status $DEPLOYMENT_STATUS"
212212
exit 1
213213
214+
test-deployment-on-all-architectures:
215+
needs: [set-release-version, load-platform-matrix, publish-to-maven-central-deployment]
216+
env:
217+
JAVA_VERSION: "11"
218+
RELEASE_VERSION: ${{ needs.set-release-version.outputs.RELEASE_VERSION }}
219+
strategy:
220+
# Run all jobs
221+
fail-fast: false
222+
matrix:
223+
host: ${{ fromJson(needs.load-platform-matrix.outputs.PLATFORM_MATRIX) }}
224+
225+
runs-on: ${{ matrix.host.RUNNER }}
226+
steps:
227+
- name: Start Valkey server
228+
uses: ./.github/actions/install-valkey
229+
with:
230+
engine-version: "7.2.5"
231+
target: ${{ matrix.host.TARGET }}
232+
214233
- uses: actions/checkout@v4
215234
with:
216235
submodules: recursive
@@ -219,7 +238,14 @@ jobs:
219238
uses: actions/setup-java@v4
220239
with:
221240
distribution: "temurin"
222-
java-version: "11"
241+
java-version: ${{ env.JAVA_VERSION }}
242+
243+
- name: Install shared software dependencies
244+
uses: ./.github/workflows/install-shared-dependencies
245+
with:
246+
os: ${{ matrix.host.OS }}
247+
target: ${{ matrix.host.TARGET }}
248+
github-token: ${{ secrets.GITHUB_TOKEN }}
223249

224250
- name: Install protoc (protobuf)
225251
uses: arduino/setup-protoc@v3
@@ -235,16 +261,9 @@ jobs:
235261
export GLIDE_RELEASE_VERSION=${{ env.RELEASE_VERSION }}
236262
./gradlew :benchmarks:run --args="--minimal --clients glide"
237263
238-
- name: Drop deployment if validation fails
239-
if: ${{ failure() }}
240-
run: |
241-
curl --request DELETE \
242-
-u "${{ secrets.CENTRAL_TOKEN_USERNAME }}:${{ secrets.CENTRAL_TOKEN_PASSWORD }}" \
243-
"https://central.sonatype.com/api/v1/publisher/deployment/${{ env.DEPLOYMENT_ID }}"
244-
245264
publish-release-to-maven:
246265
if: ${{ inputs.maven_publish == true || github.event_name == 'push' }}
247-
needs: [publish-to-maven-central-deployment]
266+
needs: [test-deployment-on-all-architectures]
248267
runs-on: ubuntu-latest
249268
environment: AWS_ACTIONS
250269
env:
@@ -255,3 +274,17 @@ jobs:
255274
curl --request POST \
256275
-u "${{ secrets.CENTRAL_TOKEN_USERNAME }}:${{ secrets.CENTRAL_TOKEN_PASSWORD }}" \
257276
"https://central.sonatype.com/api/v1/publisher/deployment/${{ env.DEPLOYMENT_ID }}"
277+
278+
drop-deployment-if-validation-fails:
279+
if: ${{ failure() }}
280+
needs: [publish-to-maven-central-deployment, test-deployment-on-all-architectures]
281+
runs-on: ubuntu-latest
282+
env:
283+
DEPLOYMENT_ID: ${{ needs.publish-to-maven-central-deployment.outputs.DEPLOYMENT_ID }}
284+
steps:
285+
- name: Drop deployment if validation fails
286+
run: |
287+
curl --request DELETE \
288+
-u "${{ secrets.CENTRAL_TOKEN_USERNAME }}:${{ secrets.CENTRAL_TOKEN_PASSWORD }}" \
289+
"https://central.sonatype.com/api/v1/publisher/deployment/${{ env.DEPLOYMENT_ID }}"
290+

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@
140140
* Python: Fix `XClaim` return type to `List[bytes]` instead of `List[TEncodable]` ([#2075](https://github.com/valkey-io/valkey-glide/pull/2075))
141141

142142
### Operational Enhancements
143-
* Node: Get valkey/redis version using client's info command ([#2276]https://github.com/valkey-io/valkey-glide/pull/2276)
143+
* CI/CD: Create Workflow to deploy artifacts for all platforms ([#2285](https://github.com/valkey-io/valkey-glide/pull/2285)
144+
* Node: Get valkey/redis version using client's info command ([#2276](https://github.com/valkey-io/valkey-glide/pull/2276))
144145
* Java: Fetch server version using client's info command ([#2258](https://github.com/valkey-io/valkey-glide/pull/2258))
145146
* CI/CD: Add workflow for automating Maven release ([#2128](https://github.com/valkey-io/valkey-glide/pull/2128))
146147

java/benchmarks/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
// Apply the application plugin to add support for building a CLI application in Java.
33
id 'application'
4+
id "com.google.osdetector" version "1.7.3"
45
}
56

67
repositories {
@@ -12,7 +13,7 @@ dependencies {
1213
def releaseVersion = System.getenv("GLIDE_RELEASE_VERSION");
1314

1415
if (releaseVersion) {
15-
implementation "io.valkey:valkey-glide:" + releaseVersion
16+
implementation "io.valkey:valkey-glide:" + releaseVersion + ":${osdetector.classifier}"
1617
} else {
1718
implementation project(':client')
1819
}

0 commit comments

Comments
 (0)