Skip to content

Commit 5b19a6f

Browse files
committed
ci: publish test package on release
1 parent ff73941 commit 5b19a6f

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: 'Build and Publish Python Package'
2+
description: 'Builds a Python package and uploads it to PyPI.'
3+
4+
inputs:
5+
repository:
6+
description: 'The repository to upload the package to.'
7+
required: true
8+
token:
9+
description: 'The token to authenticate with PyPI.'
10+
required: true
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Build and publish test package
16+
shell: bash
17+
env:
18+
TWINE_REPOSITORY: ${{ inputs.repository }}
19+
TWINE_USERNAME: __token__
20+
TWINE_PASSWORD: ${{ inputs.token }}
21+
run: |
22+
pip install setuptools wheel twine
23+
python setup.py sdist bdist_wheel
24+
twine upload dist/*

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ jobs:
3737
git commit --message ${{ github.event.inputs.version }} setup.py
3838
git tag v${{ github.event.inputs.version }}
3939
40+
- uses: ./.github/actions/python-build-publish
41+
with:
42+
repository: testpypi
43+
token: ${{ secrets.test_pypi_token }}
44+
4045
- name: Push release commit
4146
run: git push --tags origin ${{ github.ref_name }}
4247

0 commit comments

Comments
 (0)