chore(deps): bump jsonpath-plus and @stoplight/spectral-core #1244
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
name: OpenAPI Specification CI | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
name: Lint OpenAPI specification | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
- uses: actions/checkout@v4 | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-v16-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-v16 | |
- name: Install Dependencies | |
run: npm install | |
- name: Run Spectral linting | |
run: npm run lint | |
bundle: | |
needs: lint | |
runs-on: ubuntu-latest | |
name: Bundle and Filter OpenAPI specification | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
- uses: actions/checkout@v4 | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-v16-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-v16 | |
- name: Bundle OpenAPI Specification 📦 | |
run: npm run bundle | |
- name: Upload Bundled Specification as Artifact 📤 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: openapi-bundled | |
path: dist | |
pages: | |
# Only if main branch | |
if: github.ref == 'refs/heads/main' | |
needs: bundle | |
runs-on: ubuntu-latest | |
name: Upload OpenAPI specification to GitHub Pages | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: openapi-bundled | |
path: dist | |
- name: Disable Jekyll for Github Pages | |
run: sudo touch dist/.nojekyll; sudo touch dist/index.html | |
- name: Prevent Cloudflare Pages (used for dev preview) from breaking | |
run: mkdir dist/dist; cp dist/openapi.yaml dist/dist/openapi.yaml; cp .github/files/empty.json dist/package.json | |
- name: Deploy Bundle to Github Pages 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
folder: dist | |
version_check: | |
# Only if tag "release/*" is pushed | |
if: ${{ startsWith(github.ref, 'refs/tags/release/') }} | |
needs: bundle | |
name: Check if OpenAPI specification version is matching tag | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check if OpenAPI specification version is matching tag | |
# Tag will be e.g., "release/1.0.0", check if this matches the version in openapi/openapi.yaml | |
run: | | |
if [[ $(cat openapi/openapi.yaml | grep -oP '(?<=version: ).*') != $(echo $GITHUB_REF | grep -oP '(?<=release/).*') ]]; then | |
echo "OpenAPI specification version does not match tag!" | |
exit 1 | |
fi | |
# https://blog.marcnuri.com/triggering-github-actions-across-different-repositories | |
# Make sure this is same as in sdk_generate.yaml | |
sdk_generate: | |
runs-on: ubuntu-latest | |
needs: version_check | |
name: Trigger Remote SDK builds | |
strategy: | |
matrix: | |
project: | |
- javascript | |
- csharp | |
- python | |
- java | |
- rust | |
- dart | |
steps: | |
- name: Triggering build SDK - ${{ matrix.node }} | |
run: | | |
curl -X POST https://api.github.com/repos/vrchatapi/vrchatapi-${{ matrix.project }}/dispatches \ | |
-H 'Accept: application/vnd.github.everest-preview+json' \ | |
-u ${{ secrets.ACCESS_TOKEN }} \ | |
--data '{"event_type": "spec_release"}' |