-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (42 loc) · 1.38 KB
/
publish-dev-release-to-pypi.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
---
name: Publish dev-release to PyPI
on:
pull_request:
types:
- closed
env:
TOKEN: ${{ secrets.GH_TOKEN }}
# API tokens require username "__token__".
# Repo names other than pypi.org must be configured with:
# % poetry config repositories.testpypi https://test.pypi.org/legacy/
# and the env vars must be named accordingly:
# - POETRY_HTTP_BASIC_<REPO>_USERNAME
# - POETRY_PYPI_TOKEN_<REPO>
POETRY_HTTP_BASIC_PYPI_USERNAME: __token__
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_DASCHBOT_TOKEN }}
jobs:
publish-dev-release-to-pypi:
if: github.event.pull_request.merged == true && (startsWith(github.event.pull_request.title, 'fix') || startsWith(github.event.pull_request.title, 'feat'))
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry install
poetry self add poetry-exec-plugin
- name: bump version in pyproject.toml
run: poetry exec bump-version
- name: build wheel
run: |
rm -rf dist/ build/
poetry build
- name: publish new version to PyPI
run: poetry publish