Skip to content

Commit

Permalink
CI: releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Mar 17, 2021
1 parent e5de181 commit 0a32bf9
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/release-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: PyPI Release

# https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the main branch
push:
branches: [master]
release:
types: [published]

# based on https://github.com/pypa/gh-action-pypi-publish

jobs:
build:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install dependencies
run: >-
python -m pip install --user --upgrade setuptools wheel
- name: Build
run: >-
python setup.py sdist # bdist_wheel # todo: add wheel build for all OS/python
# We do this, since failures on test.pypi aren't that bad
- name: Publish to Test PyPI
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/

- name: Publish distribution 📦 to PyPI
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}

0 comments on commit 0a32bf9

Please sign in to comment.