Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a171b84
ci: bump actions and node to 24 so the generator loads
ariesclark Aug 9, 2026
8355ebe
ci: run build and test workflows on every branch
ariesclark Aug 9, 2026
2446494
ci: use the shared SDK specification action
ariesclark Aug 9, 2026
47f7dff
ci: generate from the legacy bundle this SDK ships from
ariesclark Aug 9, 2026
e057ed7
ci: build against the bundle this SDK generates from
ariesclark Aug 9, 2026
3b7b0d5
ci: let setup decide where the bundle comes from
ariesclark Aug 9, 2026
999942e
ci: cache dependencies and drop redundant setup
ariesclark Aug 9, 2026
9f55dda
ci: run the generator from its jar instead of an npm wrapper
ariesclark Aug 9, 2026
0d79269
ci: use the renamed setup-generator and download actions
ariesclark Aug 9, 2026
1c749e1
ci: split the checks into their own jobs and separate release
ariesclark Aug 9, 2026
d3ce494
ci: give generation its own job ahead of the checks
ariesclark Aug 9, 2026
fd03a7e
ci: fold the standalone checks into the ci workflow
ariesclark Aug 9, 2026
a028543
ci: run the checks once per change
ariesclark Aug 9, 2026
6be7cb5
ci: run the checks on every branch
ariesclark Aug 9, 2026
73dafac
ci: report how to install what this run built
ariesclark Aug 9, 2026
8e64040
ci: report how to install what this run built
ariesclark Aug 9, 2026
6f2b408
ci: let each SDK report itself
ariesclark Aug 9, 2026
a14c7ff
ci: publish from the ci workflow
ariesclark Aug 9, 2026
1caadb9
fix(ci): only publish from the SDK's own repository
ariesclark Aug 9, 2026
a34258f
ci: use the actions from the specification's main branch
ariesclark Aug 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 70 additions & 48 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,79 +1,101 @@
on:
push:
branches:
- '**'
pull_request:
repository_dispatch:
types: [release]
workflow_dispatch:
inputs:
json:
description: 'Passed json from repository_dispatch'
description: Passed json from repository_dispatch
required: true
type: string
version_postfix:
description: 'Additional string to concatenate onto the existing version before release'
description: Additional string to concatenate onto the existing version before release
required: false
type: string
default: ''
workflow_call:
inputs:
ref:
description: Ref of this repository to build.
required: false
type: string
default: main

name: Generate VRChat API SDK
name: CI

env:
PASSED_VERSION: ${{ (github.event_name == 'repository_dispatch' && github.event.client_payload || fromJSON(inputs.json || '{}'))['version'] }}
VERSION_POSTPEND: ${{ github.event_name == 'workflow_dispatch' && inputs.version_postfix || '' }}
Comment on lines +29 to +31

jobs:
generate:
runs-on: ubuntu-latest
name: Generate VRChat API SDK
env:
ARTIFACT_NAME: "openapi.yaml"
INPUT: ${{ github.event_name == 'repository_dispatch' && toJSON(github.event.client_payload) || inputs.json }}
SPEC_URL: ${{ (github.event_name == 'repository_dispatch' && github.event.client_payload || fromJSON(inputs.json))['artifacts']['openapi-legacy.yaml'] }}
PASSED_VERSION: ${{ (github.event_name == 'repository_dispatch' && github.event.client_payload || fromJSON(inputs.json))['version'] }}
VERSION_POSTPEND: ${{ github.event_name == 'workflow_dispatch' && inputs.version_postfix || '' }}
steps:
- uses: actions/setup-node@v3
- uses: actions/checkout@v7
with:
node-version: 16
repository: vrchatapi/vrchatapi-java
ref: ${{ inputs.ref || github.ref }}

- uses: vrchatapi/specification/.github/actions/setup-generator@main

- uses: vrchatapi/specification/.github/actions/download@main
with:
bundle: openapi-legacy.yaml

- if: env.VERSION_POSTPEND != ''
run: yq '--inplace' ".info.version |= \"${PASSED_VERSION}${VERSION_POSTPEND}\"" openapi-legacy.yaml

- run: bash ./generate.sh openapi-legacy.yaml

- uses: actions/checkout@v3
- uses: actions/upload-artifact@v7
with:
name: java-generated
path: .
include-hidden-files: true

- name: 'Cache node_modules'
uses: actions/cache@v3
test:
needs: generate
runs-on: ubuntu-latest
strategy:
matrix:
java: ['17', '21']
steps:
- uses: actions/download-artifact@v8
with:
path: node_modules
key: ${{ runner.os }}-node-v16-${{ hashFiles('**/generate.sh') }}
restore-keys: |
${{ runner.os }}-node-v16
name: java-generated

- name: Install OpenAPI Generator CLI
run: npm install @openapitools/openapi-generator-cli
- uses: actions/setup-java@v5.7.0
with:
java-version: ${{ matrix.java }}
distribution: temurin
cache: maven

- name: Set OpenAPI Generator version
run: ./node_modules/\@openapitools/openapi-generator-cli/main.js version-manager set 7.24.0
- run: mvn -B package --no-transfer-progress

- name: Download Specification
run: wget "${SPEC_URL}" '--output-document' "${ARTIFACT_NAME}"
publish:
needs:
- generate
- test
if: github.repository == 'vrchatapi/vrchatapi-java'
&& (github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
repository: vrchatapi/vrchatapi-java

- name: Apply Version Postpend
if: ${{ github.event_name == 'workflow_dispatch' && inputs.version_postfix != '' }}
run: yq '--inplace' ".info.version |= \"${{ env.PASSED_VERSION}}${{ env.VERSION_POSTPEND }}\"" "${ARTIFACT_NAME}"
- uses: actions/download-artifact@v8
with:
name: java-generated

- name: Generate SDK Client
run: bash ./generate.sh "${ARTIFACT_NAME}"
- run: rm -f openapi-legacy.yaml

- name: Deploy SDK back into main branch and make tag
uses: JamesIves/github-pages-deploy-action@v4
- uses: JamesIves/github-pages-deploy-action@v4.9.0
with:
branch: main
folder: .
commit-message: "Upgrade Java SDK to spec ${{ env.PASSED_VERSION}}${{ env.VERSION_POSTPEND }}"
tag: ${{ env.PASSED_VERSION}}${{ env.VERSION_POSTPEND }}

# gradle:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Set up JDK 13
# uses: actions/setup-java@v2
# with:
# java-version: '13'
# distribution: 'adopt'
# - name: Validate Gradle wrapper
# uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
# - name: Build with Gradle
# run: chmod ugo+x gradlew; ./gradlew build
commit-message: Upgrade Java SDK to spec ${{ env.PASSED_VERSION }}${{ env.VERSION_POSTPEND }}
tag: ${{ env.PASSED_VERSION }}${{ env.VERSION_POSTPEND }}
30 changes: 0 additions & 30 deletions .github/workflows/maven.yml

This file was deleted.

2 changes: 1 addition & 1 deletion generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rm src/main/java/io/github/vrchatapi/api -rf
rm src/main/java/io/github/vrchatapi/auth -rf
rm src/main/java/io/github/vrchatapi/model -rf

./node_modules/\@openapitools/openapi-generator-cli/main.js generate \
openapi-generator generate \
-g java \
--global-property skipFormModel=false \
--additional-properties=groupId=io.github.vrchatapi,apiPackage=io.github.vrchatapi.api,invokerPackage=io.github.vrchatapi,modelPackage=io.github.vrchatapi.model,artifactId=vrchatapi,licenseName=MIT,licenseUrl=https://github.com/vrchatapi/vrchatapi-java/blob/main/LICENSE,developerEmail=me@ruby.js.org,developerName=VRChatAPI,developerOrganization=vrchatapi,developerOrganizationUrl=https://github.com/VRChatAPI,hideGenerationTimestamp=true \
Expand Down
1 change: 0 additions & 1 deletion openapitools.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.24.0"
Expand Down
Loading
Loading