Skip to content

Commit

Permalink
Java: Create Workflow to deploy artifacts for all platforms mentioned…
Browse files Browse the repository at this point in the history
… in build.matrix.json (valkey-io#2285)


Signed-off-by: Chloe Yip <[email protected]>
  • Loading branch information
cyip10 authored Sep 14, 2024
1 parent 74836e4 commit c0ccc79
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 11 deletions.
51 changes: 42 additions & 9 deletions .github/workflows/java-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,25 @@ jobs:
echo "Deployment ${{ env.DEPLOYMENT_ID }} was unsuccessful with status $DEPLOYMENT_STATUS"
exit 1
test-deployment-on-all-architectures:
needs: [set-release-version, load-platform-matrix, publish-to-maven-central-deployment]
env:
JAVA_VERSION: "11"
RELEASE_VERSION: ${{ needs.set-release-version.outputs.RELEASE_VERSION }}
strategy:
# Run all jobs
fail-fast: false
matrix:
host: ${{ fromJson(needs.load-platform-matrix.outputs.PLATFORM_MATRIX) }}

runs-on: ${{ matrix.host.RUNNER }}
steps:
- name: Start Valkey server
uses: ./.github/actions/install-valkey
with:
engine-version: "7.2.5"
target: ${{ matrix.host.TARGET }}

- uses: actions/checkout@v4
with:
submodules: recursive
Expand All @@ -219,7 +238,14 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "11"
java-version: ${{ env.JAVA_VERSION }}

- name: Install shared software dependencies
uses: ./.github/workflows/install-shared-dependencies
with:
os: ${{ matrix.host.OS }}
target: ${{ matrix.host.TARGET }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install protoc (protobuf)
uses: arduino/setup-protoc@v3
Expand All @@ -235,16 +261,9 @@ jobs:
export GLIDE_RELEASE_VERSION=${{ env.RELEASE_VERSION }}
./gradlew :benchmarks:run --args="--minimal --clients glide"
- name: Drop deployment if validation fails
if: ${{ failure() }}
run: |
curl --request DELETE \
-u "${{ secrets.CENTRAL_TOKEN_USERNAME }}:${{ secrets.CENTRAL_TOKEN_PASSWORD }}" \
"https://central.sonatype.com/api/v1/publisher/deployment/${{ env.DEPLOYMENT_ID }}"
publish-release-to-maven:
if: ${{ inputs.maven_publish == true || github.event_name == 'push' }}
needs: [publish-to-maven-central-deployment]
needs: [test-deployment-on-all-architectures]
runs-on: ubuntu-latest
environment: AWS_ACTIONS
env:
Expand All @@ -255,3 +274,17 @@ jobs:
curl --request POST \
-u "${{ secrets.CENTRAL_TOKEN_USERNAME }}:${{ secrets.CENTRAL_TOKEN_PASSWORD }}" \
"https://central.sonatype.com/api/v1/publisher/deployment/${{ env.DEPLOYMENT_ID }}"
drop-deployment-if-validation-fails:
if: ${{ failure() }}
needs: [publish-to-maven-central-deployment, test-deployment-on-all-architectures]
runs-on: ubuntu-latest
env:
DEPLOYMENT_ID: ${{ needs.publish-to-maven-central-deployment.outputs.DEPLOYMENT_ID }}
steps:
- name: Drop deployment if validation fails
run: |
curl --request DELETE \
-u "${{ secrets.CENTRAL_TOKEN_USERNAME }}:${{ secrets.CENTRAL_TOKEN_PASSWORD }}" \
"https://central.sonatype.com/api/v1/publisher/deployment/${{ env.DEPLOYMENT_ID }}"
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@
* Python: Fix `XClaim` return type to `List[bytes]` instead of `List[TEncodable]` ([#2075](https://github.com/valkey-io/valkey-glide/pull/2075))

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

Expand Down
3 changes: 2 additions & 1 deletion java/benchmarks/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
id 'application'
id "com.google.osdetector" version "1.7.3"
}

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

if (releaseVersion) {
implementation "io.valkey:valkey-glide:" + releaseVersion
implementation "io.valkey:valkey-glide:" + releaseVersion + ":${osdetector.classifier}"
} else {
implementation project(':client')
}
Expand Down

0 comments on commit c0ccc79

Please sign in to comment.