-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from saimn/publish
Add workflow to publish on PyPI
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters