-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added logger-swagger generate action
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
on: | ||
push: | ||
paths: | ||
- logger/** | ||
|
||
jobs: | ||
swagger-mix: | ||
runs-on: ubuntu-latest | ||
name: Run protoc gen-swagger compiler on logger | ||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
- name: Install protoc | ||
run: sudo apt-get install -y protobuf-compiler | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.22 | ||
- name: Instal protoc-gen-swagger | ||
run: go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@latest | ||
- name: Run compiler | ||
run: protoc -I./annotations -I./general/general.proto -I./logger -I. --swagger_out=version=false,json_names_for_fields=false,allow_delete_body=true,include_package_in_tags=false,allow_repeated_fields_in_body=false,fqn_for_swagger_name=false,merge_file_name=logger,allow_merge=true:./swagger ./logger/*.proto | ||
- name: Run swagger-mix | ||
run: go run github.com/msample/swagger-mixin@latest swagger/engine.swagger.json swagger/storage.swagger.json swagger/messages.swagger.json swagger/logger.swagger.json swagger/contacts.swagger.json swagger/webitel-go.swagger.json swagger/wfm.swagger.json > swagger/api.json | ||
- name: Push changes | ||
if: always() | ||
run: | | ||
git add swagger/api.json | ||
git add swagger/logger.swagger.json | ||
git config --global user.name 'webitel-bot' | ||
git config --global user.email '[email protected]' | ||
git commit -am "Automated logger.swagger.json generation" | ||
git push |