ci: let each SDK report itself #221
Workflow file for this run
This file contains hidden or 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: | |
| branches: | |
| - '**' | |
| pull_request: | |
| workflow_call: | |
| inputs: | |
| ref: | |
| description: Ref of this repository to build. | |
| required: false | |
| type: string | |
| default: main | |
| name: CI | |
| jobs: | |
| generate: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.version.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| repository: vrchatapi/vrchatapi-javascript | |
| ref: ${{ inputs.ref || github.ref }} | |
| - uses: vrchatapi/specification/.github/actions/download@ci/modernise-actions | |
| - uses: pnpm/setup@v2 | |
| with: | |
| runtime: node@24 | |
| cache: true | |
| - run: pnpm generate | |
| - id: version | |
| run: | | |
| version=$(jq -r '.info.version' ./openapi.json) | |
| version=$(node -p " | |
| const semver = require('semver'); | |
| const version = semver.parse('$version'); | |
| version.major += 1; | |
| version.minor += 2; | |
| version.format(); | |
| ") | |
| echo "version=$version" >> $GITHUB_OUTPUT | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: generated-javascript | |
| path: src/generated | |
| build: | |
| needs: generate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| repository: vrchatapi/vrchatapi-javascript | |
| ref: ${{ inputs.ref || github.ref }} | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: generated-javascript | |
| path: src/generated | |
| - uses: pnpm/setup@v2 | |
| with: | |
| runtime: node@24 | |
| cache: true | |
| - run: pnpm version ${{ needs.generate.outputs.version }} --no-git-tag-version | |
| - run: pnpm build | |
| - id: preview | |
| run: | | |
| pnpm exec pkg-pr-new publish \ | |
| --packageManager=pnpm \ | |
| --no-template \ | |
| --commentWithSha \ | |
| --json preview.json \ | |
| --comment=${{ github.repository == 'vrchatapi/vrchatapi-javascript' && 'update' || 'off' }} | |
| echo "install=pnpm add $(jq -r '.packages[0].url' preview.json)" >> $GITHUB_OUTPUT | |
| - uses: vrchatapi/specification/.github/actions/report@ci/modernise-actions | |
| with: | |
| sdk: javascript | |
| install: ${{ steps.preview.outputs.install }} |