Skip to content

Commit 399df0c

Browse files
committed
chore(ci): fetch the specification by release tag
1 parent a57cc19 commit 399df0c

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ on:
77
types: [release]
88
workflow_dispatch:
99
inputs:
10-
json:
11-
description: Passed json from repository_dispatch
12-
required: true
10+
tag:
11+
description: Release to build, such as v1.22.1 or nightly. Defaults to the latest release.
12+
required: false
1313
type: string
14+
default: ''
1415
version_postfix:
1516
description: Additional string to concatenate onto the existing version before release
1617
required: false
@@ -27,12 +28,13 @@ on:
2728
name: CI
2829

2930
env:
30-
PASSED_VERSION: ${{ (github.event_name == 'repository_dispatch' && github.event.client_payload || fromJSON(inputs.json || '{}'))['version'] }}
3131
VERSION_POSTPEND: ${{ github.event_name == 'workflow_dispatch' && inputs.version_postfix || '' }}
3232

3333
jobs:
3434
generate:
3535
runs-on: ubuntu-latest
36+
outputs:
37+
version: ${{ steps.version.outputs.version }}
3638
steps:
3739
- uses: actions/checkout@v7
3840
with:
@@ -44,9 +46,13 @@ jobs:
4446
- uses: vrchatapi/specification/.github/actions/download@main
4547
with:
4648
bundle: openapi-3.1.yaml
49+
tag: ${{ inputs.tag }}
50+
51+
- id: version
52+
run: echo "version=$(yq -r '.info.version' openapi-3.1.yaml)${VERSION_POSTPEND}" >> $GITHUB_OUTPUT
4753

4854
- if: env.VERSION_POSTPEND != ''
49-
run: yq '--inplace' ".info.version |= \"${PASSED_VERSION}${VERSION_POSTPEND}\"" openapi-3.1.yaml
55+
run: yq '--inplace' ".info.version |= \"${{ steps.version.outputs.version }}\"" openapi-3.1.yaml
5056

5157
- run: bash ./generate.sh openapi-3.1.yaml
5258

@@ -104,5 +110,5 @@ jobs:
104110
with:
105111
branch: main
106112
folder: .
107-
commit-message: Upgrade Java SDK to spec ${{ env.PASSED_VERSION }}${{ env.VERSION_POSTPEND }}
108-
tag: ${{ env.PASSED_VERSION }}${{ env.VERSION_POSTPEND }}
113+
commit-message: Upgrade Java SDK to spec ${{ needs.generate.outputs.version }}
114+
tag: ${{ needs.generate.outputs.version }}

0 commit comments

Comments
 (0)