Skip to content

Commit 9f3706a

Browse files
committed
Initial workflows to build and publish Java client v4
1 parent e40023f commit 9f3706a

File tree

4 files changed

+151
-1
lines changed

4 files changed

+151
-1
lines changed
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Java Client v4 Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'conductor-clients/java/conductor-java-sdk/**'
9+
pull_request:
10+
branches:
11+
- main
12+
paths:
13+
- 'conductor-clients/java/conductor-java-sdk/**'
14+
workflow_dispatch:
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
name: Java Client v4 Build
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
- name: Set up Zulu JDK 17
24+
uses: actions/setup-java@v3
25+
with:
26+
distribution: "zulu"
27+
java-version: "17"
28+
- name: Build
29+
run: |
30+
cd conductor-clients/java/conductor-java-sdk
31+
./gradlew clean build -x :tests:build
32+
- name: Publish Test Report
33+
uses: mikepenz/action-junit-report@v3
34+
if: always()
35+
with:
36+
report_paths: 'conductor-clients/java/**/build/test-results/test/TEST-*.xml'
37+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Java Client v4 Integration Tests
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Java Client v4 Build"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
integrations-tests:
11+
runs-on: ubuntu-latest
12+
environment: integration-tests
13+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
14+
name: Java Client v4 Integration test
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.workflow_run.head_sha }}
20+
repository: ${{ github.event.workflow_run.repository.full_name }}
21+
- name: Set up Zulu JDK 17
22+
uses: actions/setup-java@v3
23+
with:
24+
distribution: "zulu"
25+
java-version: "17"
26+
- name: Run Integration tests
27+
run: |
28+
cd conductor-clients/java/conductor-java-sdk
29+
./gradlew -p tests test
30+
env:
31+
CONDUCTOR_SERVER_URL: ${{ secrets.CONDUCTOR_SERVER_URL }}
32+
CONDUCTOR_SERVER_AUTH_KEY: ${{ secrets.CONDUCTOR_SERVER_AUTH_KEY }}
33+
CONDUCTOR_SERVER_AUTH_SECRET: ${{ secrets.CONDUCTOR_SERVER_AUTH_SECRET }}
34+
- name: Publish Test Report
35+
uses: mikepenz/action-junit-report@v3
36+
if: always()
37+
with:
38+
report_paths: 'conductor-clients/java/**/build/test-results/test/TEST-*.xml'
39+
- name: Set PR Status to Failure
40+
if: ${{ failure() }}
41+
uses: actions/github-script@v6
42+
with:
43+
script: |
44+
const { owner, repo } = context.repo;
45+
const sha = context.payload.workflow_run.head_sha;
46+
await github.rest.repos.createCommitStatus({
47+
owner: owner,
48+
repo: repo,
49+
sha: sha,
50+
state: 'failure',
51+
context: 'Java Client v4 Integration Tests',
52+
description: 'Integration tests failed.',
53+
});
54+
- name: Set PR Status to Success
55+
if: ${{ success() }}
56+
uses: actions/github-script@v6
57+
with:
58+
script: |
59+
const { owner, repo } = context.repo;
60+
const sha = context.payload.workflow_run.head_sha;
61+
await github.rest.repos.createCommitStatus({
62+
owner: owner,
63+
repo: repo,
64+
sha: sha,
65+
state: 'success',
66+
context: 'Java Client v4 Integration Tests',
67+
description: 'Integration tests succeeded.',
68+
});
69+
70+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: Publish Java Client v4 to Maven Central
7+
8+
on:
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: 'Version to publish (e.g., v1.0.0)'
13+
required: true
14+
maven_central:
15+
description: 'Publish to Maven Central'
16+
required: true
17+
default: 'true'
18+
19+
jobs:
20+
publish:
21+
runs-on: ubuntu-latest
22+
environment: prod
23+
name: Gradle Build and Publish
24+
steps:
25+
- name: Checkout repo
26+
uses: actions/checkout@v3
27+
- name: Set up Zulu JDK 17
28+
uses: actions/setup-java@v4
29+
with:
30+
distribution: 'zulu'
31+
java-version: '17'
32+
- name: Publish
33+
run: |
34+
export VERSION="${{ github.event.inputs.version }}"
35+
export CONDUCTOR_CLIENT_VERSION=`echo ${VERSION:1}`
36+
echo Publishing version $CONDUCTOR_CLIENT_VERSION
37+
cd conductor-clients/java/conductor-java-sdk
38+
./gradlew publish -Pversion=$CONDUCTOR_CLIENT_VERSION -PmavenCentral=${{ github.event.inputs.maven_central }} -Pusername=${{ secrets.SONATYPE_USERNAME }} -Ppassword=${{ secrets.SONATYPE_PASSWORD }}
39+
env:
40+
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
41+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
42+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
43+
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=3.0.0-alpha16-SNAPSHOT
1+
version=4.0.0-alpha-SNAPSHOT

0 commit comments

Comments
 (0)