-
-
Notifications
You must be signed in to change notification settings - Fork 211
44 lines (41 loc) · 1.23 KB
/
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
name: Release
on:
release:
types: [created]
jobs:
publish-pypi:
name: Publish to PyPi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
# NOTE: we cannot do this here, as we're on a tag and not a branch
#- name: Bump version
# run: |
# # set pyproject.toml version to github.ref_name (without v prefix)
# VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
# poetry version $VERSION
#- name: Commit version bump
# run: |
# git config --global user.name github-actions
# git config --global user.email [email protected]
# if git diff --quiet; then
# echo "No changes to commit"
# else
# git add pyproject.toml
# git commit -m "chore: bump version to $(poetry version)"
# git push
# fi
- name: Build
run: poetry build
- name: Publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --username=__token__ --password=$PYPI_TOKEN