Skip to content

Merge pull request #762 from otizonaizit/homezone_only_valid #33

Merge pull request #762 from otizonaizit/homezone_only_valid

Merge pull request #762 from otizonaizit/homezone_only_valid #33

Workflow file for this run

name: Publish release to PyPI
on:
push:
branches:
- main
release:
types:
- created
jobs:
build-and-publish:
name: Build and publish Python distributions to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- 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
# We’d like to always publish to Test PyPI in order to spot errors with
# the publish step, however, this would require a new version each time
# we make a (test) release. For now, use the same logic for test as for
# the real release.
if: startsWith(github.ref, 'refs/tags') || github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution to PyPI
# Only publish to main PyPI when it is a tagged release
if: startsWith(github.ref, 'refs/tags') || github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}