Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish openapi #728

Merged
merged 3 commits into from
Dec 8, 2021
Merged
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
10 changes: 5 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- include a summary of the change and/or why it's necessary -->
<!-- Include a summary of the change and/or why it's necessary. -->

<!--
Checklists help us remember things.
Change [ ] to [x] to show completion, or whatever :D
Checklists help us remember things.
Change [ ] to [x] to show completion, or whatever :D
Add to .github/pull_request_template.md if you think there's something we should consider before merging.
-->

Expand All @@ -13,6 +13,6 @@ Add to .github/pull_request_template.md if you think there's something we should
- [ ] Change is backwards compatible if it needs to be (user can upgrade without manual steps?)
- [ ] Nothing sensitive logged

<!-- you can link to the issue it closes using a keyword like "resolves #1234" -->
<!-- You can link to the issue it closes using a keyword like "Resolves #1234". -->

resolves #
Resolves #
21 changes: 21 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: main

on:
release:
types:
- released
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npx @redocly/openapi-cli bundle openapi.yaml -o openapi.yaml
- uses: readmeio/github-readme-sync@v2
with:
readme-oas-key: ${{ secrets.README_API_KEY }}
oas-file-path: openapi.yaml
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: test

on:
push:
branches:
- main
pull_request:
name: test

jobs:
test:
runs-on: ubuntu-latest
Expand Down
10 changes: 2 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,10 @@ clean: helm/clean
export GO_POST_PROCESS_FILE=bash openapi/go-post-process.sh

.PHONY: openapi
openapi: openapi/clean openapi/go openapi/typescript

openapi/go: openapi/bundled.yaml
npx @openapitools/openapi-generator-cli generate --generator-key go-client
# manually post process some files since openapi-generator forgot
openapi: openapi/clean openapi/bundled.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we still need the separate openapi/bundled instruction now that we only have the one openapi make instruction?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's still necessary because someone may want to build the bundled spec separately, for example if you want to run Swagger UI

npx @openapitools/openapi-generator-cli generate
find internal/api -name '*.go' -exec $(GO_POST_PROCESS_FILE) {} \;

openapi/typescript: openapi/bundled.yaml
npx @openapitools/openapi-generator-cli generate --generator-key typescript-client

.INTERMEDIATE: openapi/bundled.yaml

openapi/bundled.yaml: openapi.yaml
Expand Down