Skip to content

Bump actions/setup-python from 5.1.0 to 5.1.1 #283

Bump actions/setup-python from 5.1.0 to 5.1.1

Bump actions/setup-python from 5.1.0 to 5.1.1 #283

name: Publish to PyPI
on: push
jobs:
build-and-publish:
name: Build and publish to PyPI
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/[email protected]
with:
python-version: '3.9'
- name: Install build dependencies
run: |
pip install -U setuptools wheel build
# This allows every individual development version to be pushed to Test PyPI
# using the timestamp as part of the version number.
- name: Add timestamp for Test PyPI
if: ${{ !(github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) }}
run: |
sed -i "\$s/\$/'\-dev$(date +%s)'/" verto/__init__.py
- name: Build distribution files
run: |
python -m build .
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
# This secret needs to be added as both an Actions secret
# and a Dependabot secret so that this workflow works for
# user pushes and dependabot pushes
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}