Skip to content

Commit e5dc1ee

Browse files
committed
ci: use the shared SDK specification action
1 parent 6025e0d commit e5dc1ee

1 file changed

Lines changed: 4 additions & 35 deletions

File tree

‎.github/workflows/build.yaml‎

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,10 @@ on:
88
spec-artifact:
99
description: >-
1010
Artifact holding the bundled specification. Only reachable when the
11-
caller shares this run, so it takes precedence over spec-url.
11+
caller shares this run; when empty the latest published one is used.
1212
required: false
1313
type: string
1414
default: ''
15-
spec-url:
16-
description: Where to download the specification from.
17-
required: false
18-
type: string
19-
default: https://github.com/vrchatapi/specification/releases/latest/download/openapi.json
2015
ref:
2116
description: Ref of this repository to build.
2217
required: false
@@ -29,16 +24,12 @@ jobs:
2924
build:
3025
runs-on: ubuntu-latest
3126
steps:
32-
# Named explicitly: when this workflow is called, the context belongs to
33-
# the caller, so a bare checkout would fetch the caller's repository.
34-
- uses: actions/checkout@v7
27+
- uses: vrchatapi/specification/.github/actions/sdk-spec@ci/modernise-actions
3528
with:
3629
repository: vrchatapi/vrchatapi-rust
3730
ref: ${{ inputs.ref || github.ref }}
38-
39-
- uses: actions/setup-node@v7
40-
with:
41-
node-version: 24
31+
generator-version: 7.21.0
32+
spec-artifact: ${{ inputs.spec-artifact }}
4233

4334
- uses: actions/setup-java@v5.7.0
4435
with:
@@ -47,30 +38,8 @@ jobs:
4738

4839
- uses: moonrepo/setup-rust@v1.3.0
4940

50-
- run: npm install @openapitools/openapi-generator-cli
51-
52-
- run: ./node_modules/\@openapitools/openapi-generator-cli/main.js version-manager set 7.21.0
53-
54-
- if: inputs.spec-artifact != ''
55-
uses: actions/download-artifact@v8
56-
with:
57-
name: ${{ inputs.spec-artifact }}
58-
path: .
59-
60-
- if: inputs.spec-artifact == ''
61-
run: curl -Lfo openapi.json "${{ inputs.spec-url || 'https://github.com/vrchatapi/specification/releases/latest/download/openapi.json' }}"
62-
6341
- run: bash ./generate.sh openapi.json
6442

6543
# The generator runs with avoidBoxedModels, so a schema that produces a
6644
# self-referential type fails to compile rather than being boxed.
6745
- run: cargo build
68-
69-
- uses: actions/upload-artifact@v7
70-
with:
71-
name: rust-${{ github.run_id }}
72-
path: |
73-
src
74-
docs
75-
Cargo.toml
76-
if-no-files-found: ignore

0 commit comments

Comments
 (0)