Skip to content

Commit

Permalink
Merge pull request #139 from saimn/publish
Browse files Browse the repository at this point in the history
Add workflow to publish on PyPI
  • Loading branch information
pllim committed Dec 16, 2020
2 parents 6df2955 + 881dfbc commit 31c5026
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/publish.yml
@@ -0,0 +1,43 @@
name: Release

on:
push:

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
if: github.repository == 'astropy/pytest-doctestplus'

steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install python-build and twine
run: python -m pip install build twine

- name: Build package
run: python -m build --sdist --wheel .

- name: List result
run: ls -l dist

- name: Check long_description
run: python -m twine check dist/*

- name: Test package
run: |
cd ..
python -m venv testenv
testenv/bin/pip install pytest pytest-doctestplus/dist/*.whl
testenv/bin/pytest pytest-doctestplus/tests --doctest-plus --doctest-rst
- name: Publish distribution 📦 to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
1 change: 1 addition & 0 deletions setup.cfg
Expand Up @@ -21,6 +21,7 @@ classifiers =
license = BSD
description = Pytest plugin with advanced doctest features.
long_description = file: README.rst
long_description_content_type = text/x-rst
keywords = doctest, rst, pytest, py.test

[options]
Expand Down

0 comments on commit 31c5026

Please sign in to comment.