Skip to content

Commit

Permalink
Merge pull request #14 from dhellmann/publish-action
Browse files Browse the repository at this point in the history
add publish action
  • Loading branch information
mergify[bot] authored May 5, 2024
2 parents 6d1071c + 18c5acf commit 2e08efc
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/python-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
- push

jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI and TestPyPI
if: ${{ github.repository_owner == 'sphinx-contrib' }}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[build]
- name: Build sdist and wheel
run: |
python -m build
# - name: Publish distribution to Test PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
# password: ${{ secrets.test_pypi_password }}
# 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:
password: ${{ secrets.pypi_password }}

0 comments on commit 2e08efc

Please sign in to comment.