Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/workflows/api-docs-update-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,33 @@ jobs:
api-docs-update-trigger:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Apply OpenAPI adjustments
run: |
cd protobuff
cp qubic.openapi.yaml qubic.openapi.adjusted.yaml
yq -i '(.tags[] | select(.name == "QubicLiveService")).x-scalar-ignore = true' qubic.openapi.adjusted.yaml

- name: Encode adjusted spec
id: encode
run: |
CONTENT=$(base64 -w 0 protobuff/qubic.openapi.adjusted.yaml)
echo "spec_base64=$CONTENT" >> "$GITHUB_OUTPUT"

- name: Dispatch to Integration
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.GH_PAT }}
repository: qubic/integration
event-type: api-docs-update
event-type: live-api-update
client-payload: '{"openapi_spec_base64": "${{ steps.encode.outputs.spec_base64 }}"}'

- name: Dispatch to Docs
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.GH_PAT }}
repository: qubic/docs
event-type: live-api-update
event-type: live-api-update
client-payload: '{"openapi_spec_base64": "${{ steps.encode.outputs.spec_base64 }}"}'
26 changes: 25 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,28 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: 1.25.x
- run: go test ./...
- run: go test ./...

check-openapi:
Copy link
Member

@qubicmio qubicmio Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this one because I don't know, if different plugin versions might generate slightly different output. (we can change this later, if we are not sure)

name: Check OpenAPI spec is up to date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.25.x
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
version: '28.x'
- name: Install protoc-gen-openapi
run: go install github.com/google/gnostic/cmd/protoc-gen-openapi@latest
- name: Regenerate OpenAPI spec
working-directory: protobuff
run: make openapi-v3
- name: Check for differences
run: |
if ! git diff --exit-code protobuff/qubic.openapi.yaml; then
echo "::error::OpenAPI spec is out of date. Run 'make openapi-v3' in protobuff/ and commit the result."
exit 1
fi
2 changes: 0 additions & 2 deletions protobuff/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ all: $(GO) openapi-v3

openapi-v3:
protoc -I=. --openapi_out=output_mode=source_relative,default_response=false:. *.proto
@# Add x-scalar-ignore to auto-generated QubicLiveService tag
yq -i '(.tags[] | select(.name == "QubicLiveService")).x-scalar-ignore = true' qubic.openapi.yaml

clean:
rm -f *.pb.go
Expand Down