Skip to content

Commit 9caeb5f

Browse files
committed
update
1 parent 26bace0 commit 9caeb5f

File tree

21 files changed

+9648
-8
lines changed

21 files changed

+9648
-8
lines changed

.github/workflows/sdk-release.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ jobs:
108108
sdk-rust:
109109
if: startsWith(github.ref, 'refs/tags/sdk-rust/')
110110
runs-on: ubuntu-latest
111+
env:
112+
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
111113
defaults:
112114
run:
113115
working-directory: api/grpc/sdk/rust/powerx-sdk
@@ -148,8 +150,8 @@ jobs:
148150
env:
149151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
150152
- name: Publish to crates.io
151-
if: ${{ secrets.CRATES_TOKEN != '' }}
152-
run: cargo publish --token ${{ secrets.CRATES_TOKEN }}
153+
if: ${{ env.CRATES_TOKEN != '' }}
154+
run: cargo publish --token "$CRATES_TOKEN"
153155

154156
sdk-php:
155157
if: startsWith(github.ref, 'refs/tags/sdk-php/')
@@ -194,6 +196,8 @@ jobs:
194196
sdk-ts:
195197
if: startsWith(github.ref, 'refs/tags/sdk-ts/')
196198
runs-on: ubuntu-latest
199+
env:
200+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
197201
defaults:
198202
run:
199203
working-directory: api/grpc/sdk/ts/packages/@powerx/grpc
@@ -238,8 +242,7 @@ jobs:
238242
env:
239243
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
240244
- name: Publish to npm
241-
if: ${{ secrets.NPM_TOKEN != '' }}
242-
run: npm publish --access public "${GITHUB_WORKSPACE}/build/${{ steps.pack.outputs.tarball }}"
243-
env:
244-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
245-
245+
if: ${{ env.NPM_TOKEN != '' }}
246+
run: |
247+
export NODE_AUTH_TOKEN="$NPM_TOKEN"
248+
npm publish --access public "${GITHUB_WORKSPACE}/build/${{ steps.pack.outputs.tarball }}"

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ etc/config.yaml
7171
# Keep the folder itself
7272
!plugins/.gitkeep
7373

74-
api/grpc/gen/
74+
api/grpc/gen/*
75+
!api/grpc/gen/go/
76+
!api/grpc/gen/go/**
7577
.gocache
7678
.cache

api/grpc/gen/go/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# PowerX Go gRPC SDK
2+
3+
本目录作为 Go Module 使用(临时方案),模块名:
4+
5+
- `module github.com/ArtisanCloud/PowerX/api/grpc/gen/go`
6+
7+
导入示例:
8+
9+
```go
10+
import (
11+
iamv1 "github.com/ArtisanCloud/PowerX/api/grpc/gen/go/powerx/iam/v1"
12+
"google.golang.org/grpc"
13+
"google.golang.org/grpc/credentials/insecure"
14+
)
15+
16+
conn, _ := grpc.Dial("127.0.0.1:9001", grpc.WithTransportCredentials(insecure.NewCredentials()))
17+
cli := iamv1.NewMemberServiceClient(conn)
18+
// ...
19+
```
20+
21+
拉取方式:
22+
23+
```bash
24+
go get github.com/ArtisanCloud/PowerX/api/grpc/gen/go@vX.Y.Z
25+
```
26+
27+
生成与更新:在 `api/grpc/contracts/` 运行 `buf generate`
28+
29+
> 说明:后续如需迁移到 `api/grpc/sdk/go/...` 或独立仓库,将统一调整 `option go_package` 并发布迁移指南。
30+

api/grpc/gen/go/common/v1/context.pb.go

Lines changed: 177 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)