Signed-off-by: nfel <nfilsaraee@gmail.com>
This commit is contained in:
nfel 2024-11-23 14:31:34 +03:30
parent 1b9e7a05d3
commit 96a0171bfd
Signed by: nfel
GPG Key ID: DCC0BF3F92B0D45F

View File

@ -1,10 +1,8 @@
---
name: Buf CI name: Buf CI
on: on:
push: push:
tags: tags:
- v* - v*
permissions: permissions:
contents: read contents: read
pull-requests: write pull-requests: write
@ -14,7 +12,7 @@ jobs:
steps: steps:
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: '>=1.23.0' go-version: ">=1.23.0"
- uses: bufbuild/buf-setup-action@v1.47.2 - uses: bufbuild/buf-setup-action@v1.47.2
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@ -23,20 +21,18 @@ jobs:
- run: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest - run: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
- run: go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest - run: go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
- run: go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest - run: go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest
- run: npm install --save @bufbuild/protobuf @bufbuild/protoc-gen-es @bufbuild/buf - run: npm install --save @bufbuild/protobuf @bufbuild/protoc-gen-es @bufbuild/buf
- run: buf --version - run: buf --version
- run: | - run: "export PATH=$PATH:./node_modules/.bin\nbuf generate \n"
export PATH=$PATH:./node_modules/.bin
buf generate
- run: | - run: |
if [ -n ${{ gitea.ref_name }} ]; then if [ -n ${{ gitea.ref_name }} ]; then
mkdir .res mkdir .res
for out in go ts doc; do for out in go ts doc; do
tar czf .res/${out}.tar.gz ./stub/${out}/ tar czf .res/${out}.tar.gz ./stub/${out}/
echo ${{ gitea.api_url }}/packages/Kahroba/generic/proto/${{ gitea.ref_name }}/${out}.tar.gz echo ${{ gitea.server_url }}/api/packages/Kahroba/generic/proto/${{ gitea.ref_name }}/${out}.tar.gz
curl --user ${{ gitea.actor }}:${{ gitea.token }} \ curl --user ${{ gitea.actor }}:${{ gitea.token }} \
--upload-file .res/${out}.tar.gz \ --upload-file .res/${out}.tar.gz \
${{ gitea.api_url }}/packages/Kahroba/generic/proto/${{ gitea.ref_name }}/${out}.tar.gz ${{ gitea.server_url }}/api/packages/Kahroba/generic/proto/${{ gitea.ref_name }}/${out}.tar.gz
done done
fi fi