Skip to content

Commit 45bbf43

Browse files
committed
adds publish workflows
1 parent cb96e7e commit 45bbf43

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.github/workflows/pre-publish.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish on TestPyPI
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- '[0-9]+.[0-9]+.[0-9]+'
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
continue-on-error: false
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Install poetry
16+
run: pipx install poetry
17+
- name: Setup Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.11"
21+
cache: poetry
22+
- name: Install
23+
run: poetry install
24+
- name: Test
25+
run: poetry run pytest
26+
- name: Publish to TestPyPI
27+
run: |
28+
poetry config repositories.test-pypi https://test.pypi.org/legacy/
29+
poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_TOKEN }}
30+
poetry publish --build -r test-pypi

.github/workflows/publish.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish on PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types:
7+
- published
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
continue-on-error: false
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Install poetry
16+
run: pipx install poetry
17+
- name: Setup Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.11"
21+
cache: poetry
22+
- name: Install
23+
run: poetry install
24+
- name: test
25+
run: poetry run pytest
26+
- name: Publish to PyPI
27+
run: |
28+
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
29+
poetry publish --build

0 commit comments

Comments
 (0)