-
Notifications
You must be signed in to change notification settings - Fork 25
39 lines (31 loc) · 976 Bytes
/
python-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
# This workflows will upload a Python Package using Poetry when a release is created
name: Publish Package
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
name: "Publish library"
steps:
- name: Check out
uses: actions/checkout@v3
with:
token: "${{ secrets.GITHUB_TOKEN }}"
fetch-depth: 0
- name: Setup Python Env
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: pip install poetry dunamai
- name: Set version
run: |
VERSION=$(dunamai from any --no-metadata --style pep440)
poetry version $VERSION
echo "__version__ = \"$VERSION\"" > aioreactive/_version.py
- name: Build package
run: poetry build
- name: Release to PyPI
run: |
poetry publish -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} || echo 'Version exists'