Repository navigation
55 lines (49 loc) · 1.6 KB
/
Copy pathsdks-python-publish.yml
File metadata and controls
55 lines (49 loc) · 1.6 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
name: Python SDK Publish To PyPI
on:
workflow_dispatch:
inputs:
version:
description: 'SemverVersion string'
required: true
jobs:
test-and-publish-sdk:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.13'
- name: Install Poetry
uses: snok/install-poetry@v1.3.4
with:
version: 2.0.0
- name: Install Protobuf
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Publish (Test PyPI)
id: publish-test-pypi
run: |
cd sdks/python
make all
python3 -m pip install --upgrade build --break-system-packages
poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_API_TOKEN }}
poetry version ${{ github.event.inputs.version }}
python3 -m build -v
poetry publish -r test-pypi
- name: Publish (Main PyPI)
id: publish-pypi
run: |
cd sdks/python
make all
python3 -m pip install --upgrade build --break-system-packages
poetry config repositories.pypi https://upload.pypi.org/legacy/
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry version ${{ github.event.inputs.version }}
python3 -m build -v
poetry publish -r pypi