-
Notifications
You must be signed in to change notification settings - Fork 20
78 lines (65 loc) · 1.81 KB
/
speakeasy_sdk_publish.yaml
File metadata and controls
78 lines (65 loc) · 1.81 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
name: PyPI Release
on:
release:
types:
- published
permissions:
contents: read
concurrency:
group: release
cancel-in-progress: false
env:
PYTHON_VERSION: "3.13"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
env:
UV_LOCKED: "1"
UV_PYTHON: ${{ env.PYTHON_VERSION }}
run: make install
- name: Validate version matches release tag
env:
TAG: ${{ github.event.release.tag_name }}
run: |
PKG_VERSION=$(PYTHONPATH=src uv run python - <<'PYEOF'
from unstructured_client._version import __version__
print(__version__)
PYEOF
)
if [[ "$TAG" != "$PKG_VERSION" && "$TAG" != "v$PKG_VERSION" ]]; then
echo "Tag '$TAG' does not match package version '$PKG_VERSION'"
exit 1
fi
- name: Build artifacts
run: uv build --out-dir dist --clear
- name: Upload dist artifacts
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
publish:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Download dist artifacts
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish package
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1