-
Notifications
You must be signed in to change notification settings - Fork 11
53 lines (51 loc) · 1.69 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
on:
repository_dispatch:
types: [spec_release]
workflow_dispatch:
#on: push
name: Generate VRChat API SDK
jobs:
generate:
runs-on: ubuntu-latest
name: Generate VRChat API SDK
steps:
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/checkout@v4
- name: 'Cache node_modules'
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-v22-${{ hashFiles('**/generate.sh') }}
restore-keys: |
${{ runner.os }}-node-v22
- name: Install OpenAPI Generator CLI
run: npm install @openapitools/openapi-generator-cli
- name: Set OpenAPI Generator version
run: ./node_modules/\@openapitools/openapi-generator-cli/main.js version-manager set 7.7.0
- name: Set up JDK 20
uses: actions/setup-java@v4
with:
java-version: '20'
distribution: 'adopt'
- name: Install Rustup toolchain
uses: moonrepo/setup-rust@v1
- name: Generate SDK Client
run: bash ./generate.sh
- name: Check version number
run: |
echo "spec_version=$(grep "^version" ./Cargo.toml | cut -d "\"" -f 2)" >> $GITHUB_ENV
- name: Print version number
run: echo ${{ env.spec_version }}
- name: Deploy SDK back into main branch
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: main
folder: .
commit-message: "Upgrade Rust SDK to spec ${{ env.spec_version }}"
- name: Deploy to Crates.io
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
args: --allow-dirty