-
Notifications
You must be signed in to change notification settings - Fork 10
58 lines (48 loc) · 1.37 KB
/
python-release.yml
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
name: Release Python client
on:
push:
tags:
- py-v*
workflow_dispatch:
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
id-token: write
env:
FORCE_COLOR: "1"
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
poetry --version
- name: Check version
working-directory: clients/python
run: |
set -o pipefail
LATEST_TAG=$(git describe --tags --match="py-v*")
if [[ "$LATEST_TAG" =~ $(poetry version | cut -d' ' -f1) ]]; then
echo "::error title='$LATEST_TAG tag does not match project version'::"
exit 1
fi
- name: Build package
working-directory: clients/python
run: |
poetry build --ansi
- name: Publish package on PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
print-hash: true
packages-dir: clients/python/dist/