mirror of
https://github.com/Rushilwiz/actions-testing.git
synced 2025-04-06 20:40:15 -04:00
42 lines
1.0 KiB
YAML
42 lines
1.0 KiB
YAML
name: Publish Python 🐍 distribution 📦 to PyPI
|
|
|
|
on: [workflow_dispatch]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python 3.8
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.8
|
|
|
|
- name: Install pypa/build
|
|
run: >-
|
|
python -m
|
|
pip install
|
|
build
|
|
--user
|
|
|
|
- name: Build a binary wheel and a source tarball
|
|
run: >-
|
|
python -m
|
|
build
|
|
--sdist
|
|
--wheel
|
|
--outdir dist/
|
|
.
|
|
- name: Publish distribution 📦 to Test PyPI
|
|
uses: pypa/gh-action-pypi-publish@master
|
|
with:
|
|
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
|
repository_url: https://test.pypi.org/legacy/
|
|
- name: Publish distribution 📦 to PyPI
|
|
if: startsWith(github.ref, 'refs/tags')
|
|
uses: pypa/gh-action-pypi-publish@master
|
|
with:
|
|
user: __token__
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|