Skip to content

Commit f2ae9db

Browse files
RoyLinRoyLin
authored andcommitted
ci: publish workflows for the Python + TS SDKs
- publish-python.yml: on a python-v* tag, test + build + twine upload to PyPI (needs PYPI_API_TOKEN) - publish-ts.yml: on a ts-v* tag, npm ci + test + npm publish --access public (needs NPM_TOKEN) Decoupled from the daemon's v* release tags; SDKs version independently (0.1.0). Integration tests auto-skip in CI (no sentry binary).
1 parent 224bcd0 commit f2ae9db

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: publish-python
2+
3+
# Publish the Python SDK to PyPI on a `python-vX.Y.Z` tag (independent of the daemon's `v*` tags).
4+
# Requires a `PYPI_API_TOKEN` repository secret.
5+
on:
6+
push:
7+
tags: ["python-v*"]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
working-directory: sdk/python
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
23+
- name: test
24+
run: python -m unittest discover -s tests -t . # integration tests auto-skip (no binary)
25+
- name: build
26+
run: |
27+
pip install --upgrade build twine
28+
python -m build
29+
- name: publish
30+
run: twine upload dist/*
31+
env:
32+
TWINE_USERNAME: __token__
33+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/publish-ts.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: publish-ts
2+
3+
# Publish the TypeScript SDK (@a3s-lab/sentry) to npm on a `ts-vX.Y.Z` tag (independent of the
4+
# daemon's `v*` tags). Requires an `NPM_TOKEN` repository secret.
5+
on:
6+
push:
7+
tags: ["ts-v*"]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
working-directory: sdk/typescript
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: "20"
23+
registry-url: "https://registry.npmjs.org"
24+
- run: npm ci
25+
- name: build + test
26+
run: npm test # tsc + node --test; the integration test auto-skips (no binary)
27+
- name: publish
28+
run: npm publish --access public
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)