-
-
Notifications
You must be signed in to change notification settings - Fork 6
133 lines (114 loc) · 3.63 KB
/
publish-sdks.yml
File metadata and controls
133 lines (114 loc) · 3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Publish SDKs
on:
release:
types: [published]
workflow_dispatch: # Manual trigger for testing
permissions:
contents: read
jobs:
# ============================================
# Python SDK → PyPI
# ============================================
publish-python:
name: Publish Python SDK
runs-on: ubuntu-latest
# Only run if PYPI_API_TOKEN exists
if: ${{ vars.PYPI_ENABLED == 'true' || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install build tools
run: pip install build twine
- name: Build package
run: |
cd sdk/python
python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
cd sdk/python
twine upload dist/* --skip-existing
continue-on-error: true # Don't fail if PyPI token not set yet
# ============================================
# TypeScript SDK → npm
# ============================================
publish-typescript:
name: Publish TypeScript SDK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: |
cd sdk-ts
npm ci
- name: Build
run: |
cd sdk-ts
npm run build
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd sdk-ts
npm publish --access public
continue-on-error: true # Don't fail on duplicate version
# ============================================
# Rust SDK → crates.io
# ============================================
publish-rust:
name: Publish Rust SDK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cd sdk-rust
cargo publish --allow-dirty
continue-on-error: true # Don't fail on duplicate version
# ============================================
# Go SDK → Just needs tag (no publish step)
# ============================================
tag-go:
name: Tag Go SDK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify Go module
run: |
cd sdk-go
go mod verify || true
- name: Print install command
run: |
echo "✅ Go SDK available at:"
echo "go get github.com/QWED-AI/qwed-verification/sdk-go@${{ github.ref_name }}"
# ============================================
# Summary
# ============================================
summary:
name: Publish Summary
needs: [publish-typescript, publish-rust, tag-go]
runs-on: ubuntu-latest
if: always()
steps:
- name: Summary
run: |
echo "=== SDK Publish Results ==="
echo "TypeScript (npm): ${{ needs.publish-typescript.result }}"
echo "Rust (crates.io): ${{ needs.publish-rust.result }}"
echo "Go (tagged): ${{ needs.tag-go.result }}"
echo ""
echo "Note: Python publish skipped until PyPI token is set"