-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (50 loc) · 1.61 KB
/
pip_publish.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
59
60
61
62
63
64
65
# This workflows will upload a Python Package when a version tag is pushed using build system from pyproject.toml
# To publish new version use `scripts/verup.sh`
# Put you pypi credentials (PYPI_USERNAME, PYPI_PASSWORD) into the github repository secrets
name: Upload Python Package
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
publish:
env:
PRIMARY_PYTHON_VERSION: '3.12'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set version var
run: |
echo "RELEASE_VERSION=$(echo ${GITHUB_REF#refs/*/} | sed 's/^v//')" >> $GITHUB_ENV
echo $RELEASE_VERSION
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install uv environment
uses: andgineer/uv-venv@v1
- name: Install build dependencies
run: uv pip install build --python=${{ env.PRIMARY_PYTHON_VERSION }}
- name: Build package
run: |
python -m build
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@v1.8.14
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
packages-dir: dist
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: Release ${{ env.RELEASE_VERSION }}
body: https://pypi.org/project/async-s3/${{ env.RELEASE_VERSION }}/
draft: false
prerelease: false