Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
8d2bdaf352
|
|||
|
9f99f4203d
|
|||
|
96a0171bfd
|
|||
|
1b9e7a05d3
|
|||
|
3c7092fb9b
|
|||
|
fcfe74d80b
|
|||
|
13a75d52de
|
|||
|
8aa875b1d6
|
|||
|
a199324bcc
|
|||
|
3ebd28b9b8
|
|||
|
f2ba3c5340
|
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
name: Buf CI
|
name: Buf CI
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -8,30 +7,39 @@ on:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
buf:
|
buf:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '>=1.18.0'
|
go-version: ">=1.23.0"
|
||||||
- uses: bufbuild/buf-setup-action@v1.47.2
|
- uses: bufbuild/buf-setup-action@v1.47.2
|
||||||
- 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: npm init -y && npm install --save-dev @bufbuild/protobuf @bufbuild/protoc-gen-es @bufbuild/buf
|
|
||||||
- run: buf --version
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
token: ${{ gitea.token }}
|
token: ${{ gitea.token }}
|
||||||
path: ./
|
path: ./
|
||||||
- run: buf generate
|
- 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 github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest
|
||||||
|
- run: npm install --save @bufbuild/protobuf @bufbuild/protoc-gen-es @bufbuild/buf
|
||||||
|
- run: buf --version
|
||||||
|
- run: "export PATH=$PATH:./node_modules/.bin\nbuf generate \n"
|
||||||
- run: |
|
- run: |
|
||||||
if [ -n ${{ gitea.ref_name }} ]; then
|
if [ -n ${{ gitea.ref_name }} ]; then
|
||||||
mkdir .res
|
mkdir .res
|
||||||
for out in go ts docs; do
|
for out in go ts doc; do
|
||||||
tar czf .res/${out}.tar.gz ./stub/${out}/ .
|
echo releasing ${out} ...
|
||||||
curl --user gitea:${{ gitea.token }} \
|
tar czf .res/${out}.tar.gz ./stub/${out}/
|
||||||
|
curl -Ss --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
|
||||||
|
echo releasing proto ...
|
||||||
|
tar czf ./.res/src.tar.gz $(find -type f -name "*.proto")
|
||||||
|
curl -Ss --user ${{ gitea.actor}}:${{ gitea.token}}\
|
||||||
|
--upload-file ./.res/src.tar.gz \
|
||||||
|
${{ gitea.server_url }}/api/packages/Kahroba/generic/proto/${{ gitea.ref_name }}/src.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|||||||
+7
-4
@@ -20,9 +20,12 @@ plugins:
|
|||||||
# - remote: buf.build/protocolbuffers/go:v1.30.0
|
# - remote: buf.build/protocolbuffers/go:v1.30.0
|
||||||
out: stub/go
|
out: stub/go
|
||||||
# NOTE: doc
|
# NOTE: doc
|
||||||
# - local: protoc-gen-doc
|
- local: protoc-gen-doc
|
||||||
# opt: html,index.html,source_relative
|
opt: html,index.html,source_relative
|
||||||
# out: stub/doc
|
out: stub/doc/html
|
||||||
|
- local: protoc-gen-doc
|
||||||
|
opt: markdown,index.md,source_relative
|
||||||
|
out: stub/doc/md
|
||||||
# # NOTE: Gateway
|
# # NOTE: Gateway
|
||||||
# # - remote: buf.build/grpc-ecosystem/gateway:v2.16.2
|
# # - remote: buf.build/grpc-ecosystem/gateway:v2.16.2
|
||||||
# - local: protoc-gen-grpc-gateway
|
# - local: protoc-gen-grpc-gateway
|
||||||
@@ -42,7 +45,7 @@ plugins:
|
|||||||
# - remote: buf.build/bufbuild/es:v2.2.2
|
# - remote: buf.build/bufbuild/es:v2.2.2
|
||||||
# # opt: import_prefix=github.com/nfel
|
# # opt: import_prefix=github.com/nfel
|
||||||
# out: stub/ts
|
# out: stub/ts
|
||||||
- local: node_modules/@bufbuild/protoc-gen-es/bin/protoc-gen-es
|
- local: protoc-gen-es
|
||||||
out: stub/ts
|
out: stub/ts
|
||||||
opt: target=ts
|
opt: target=ts
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user