forked from Haroldwonder/TrustLink
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.59 KB
/
Copy pathpublish-python-sdk.yml
File metadata and controls
57 lines (47 loc) · 1.59 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
name: Publish Python SDK to PyPI
on:
push:
tags:
- "python-v*"
permissions:
contents: read
id-token: write # required for trusted publishing (OIDC)
jobs:
build-and-publish:
name: Build and publish trustlink-sdk
runs-on: ubuntu-latest
environment: pypi
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.11"
- name: Install build tools
run: pip install --upgrade build twine
- name: Build source and wheel distributions
working-directory: bindings/python
run: python -m build
- name: Validate distributions with twine
working-directory: bindings/python
run: twine check dist/*
- name: Verify py.typed is present in wheel
working-directory: bindings/python
run: |
WHEEL=$(ls dist/*.whl)
python -c "
import zipfile, sys
whl = '$WHEEL'
with zipfile.ZipFile(whl) as z:
names = z.namelist()
marker = [n for n in names if n.endswith('py.typed')]
if not marker:
print('ERROR: py.typed not found in wheel:', names)
sys.exit(1)
print('OK: py.typed found at', marker[0])
"
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
with:
packages-dir: bindings/python/dist/