Skip to content

Commit d02320f

Browse files
committed
refactor: align Java SDK with Python SDK structure
- Refactor to match Python SDK file structure and API design - Add Config, Version classes - Refactor Client to use Map instead of custom objects - Add comprehensive test suite (27 tests, 100% pass) - Update GitHub Actions workflows - Remove OpenAPI generated code - Update documentation 🤖 Generated with Claude Code
1 parent 651a011 commit d02320f

26 files changed

+1083
-1523
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: maven-packages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v[0-9]+*"
9+
workflow_dispatch:
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # for tags
20+
21+
- name: Set up JDK 17
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: '17'
25+
distribution: 'temurin'
26+
cache: maven
27+
28+
- name: Build with Maven
29+
run: mvn -B clean package --no-transfer-progress --file pom.xml
30+
31+
- name: Run tests
32+
run: mvn -B test --no-transfer-progress --file pom.xml
33+
env:
34+
WAVESPEED_API_KEY: ${{ secrets.WAVESPEED_API_KEY }}
35+
36+
- run: ls -lh target/*.jar
37+
- uses: actions/upload-artifact@v4
38+
with:
39+
name: maven-packages
40+
path: |
41+
target/*.jar
42+
43+
# publish to GitHub Release
44+
gh_release:
45+
name: gh_release
46+
needs: build
47+
runs-on: ubuntu-latest
48+
permissions: write-all
49+
50+
timeout-minutes: 60
51+
defaults:
52+
run:
53+
shell: bash
54+
steps:
55+
- uses: actions/download-artifact@v4
56+
with:
57+
path: dist
58+
59+
- run: ls -R dist/
60+
61+
# create nightly release if it's a push to main
62+
- if: github.repository == 'WaveSpeedAI/wavespeed-java' && github.event_name == 'push' && github.ref == 'refs/heads/main'
63+
name: Nightly Release
64+
uses: andelf/nightly-release@v1
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
with:
68+
tag_name: nightly
69+
name: 'Nightly Release $$'
70+
prerelease: true
71+
body: 'TODO: Add nightly release notes'
72+
files: |
73+
dist/*/*.jar
74+
75+
# create release if it's a tag like vx.y.z
76+
- if: github.repository == 'WaveSpeedAI/wavespeed-java' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
77+
name: Release
78+
uses: softprops/action-gh-release@v1
79+
with:
80+
files: |
81+
dist/*/*.jar
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This workflow will publish the package to Maven Central when a release is created
2+
3+
name: maven-publish
4+
5+
on:
6+
release:
7+
types: [published]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0 # for tags
21+
22+
- name: Set up JDK 17
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: '17'
26+
distribution: 'temurin'
27+
cache: maven
28+
29+
- name: Configure Git
30+
run: |
31+
git config --global user.email "action@github.com"
32+
git config --global user.name "GitHub Action"
33+
34+
- name: Build with Maven
35+
run: mvn -B clean package --no-transfer-progress --file pom.xml
36+
37+
# TODO: Uncomment when Maven Central credentials are configured
38+
# - name: Publish to Maven Central
39+
# run: mvn -B deploy --no-transfer-progress --file pom.xml
40+
# env:
41+
# MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
42+
# MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
43+
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

.github/workflows/maven.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)