mirror of
https://github.com/mii443/vrchatapi-rust.git
synced 2025-08-23 16:08:06 +00:00
Add CI
This commit is contained in:
49
.github/workflows/ci.yaml
vendored
Normal file
49
.github/workflows/ci.yaml
vendored
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
#on:
|
||||||
|
# repository_dispatch:
|
||||||
|
# types: [spec_release]
|
||||||
|
on: push
|
||||||
|
|
||||||
|
name: Generate VRChat API SDK
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Generate VRChat API SDK
|
||||||
|
steps:
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: 'Cache node_modules'
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: node_modules
|
||||||
|
key: ${{ runner.os }}-node-v16-${{ hashFiles('**/generate.sh') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-v16
|
||||||
|
- name: Install OpenAPI Generator CLI
|
||||||
|
run: npm install @openapitools/openapi-generator-cli
|
||||||
|
- name: Set OpenAPI Generator version
|
||||||
|
run: openapi-generator-cli version-manager set 5.3.0
|
||||||
|
- name: Install Rustup toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
- 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@4.1.5
|
||||||
|
with:
|
||||||
|
branch: main
|
||||||
|
folder: .
|
||||||
|
commit-message: "Upgrade Rust SDK to spec ${{ env.spec_version }}"
|
||||||
|
- name: Deploy to Crates.io
|
||||||
|
uses: katyo/publish-crates@v1
|
||||||
|
with:
|
||||||
|
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
@ -2,6 +2,6 @@
|
|||||||
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
|
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
|
||||||
"spaces": 2,
|
"spaces": 2,
|
||||||
"generator-cli": {
|
"generator-cli": {
|
||||||
"version": "5.2.0"
|
"version": "5.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user