-
Notifications
You must be signed in to change notification settings - Fork 382
30 lines (27 loc) · 823 Bytes
/
release.yml
File metadata and controls
30 lines (27 loc) · 823 Bytes
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
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@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Build and publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
# set pyproject.toml version to github.ref_name (without v prefix)
# just in case someone forgot...
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
sed -i 's/^version = ".*"/version = "'"$VERSION"'"/' pyproject.toml
poetry publish --build --username=__token__ --password=$PYPI_TOKEN