Skip to content

Commit

Permalink
Merge pull request ratt-ru#92 from ratt-ru/deploy
Browse files Browse the repository at this point in the history
Add workflow to publish package on pypi
  • Loading branch information
o-smirnov authored Jan 29, 2021
2 parents 60ab7fc + 2ac060d commit 82a26d3
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Upload Python Package

on:
push:
tags:
- '**'

jobs:
deploy:
runs-on: ubuntu-latest
# Run on a push to a tag or master
if: >
github.event_name == 'push' &&
(startsWith(github.event.ref, 'refs/tags') ||
github.event.ref == 'refs/heads/master')
steps:
- name: Set up Python 3
uses: actions/setup-python@v1
with:
python-version: '3.x'

- name: Install latest setuptools, wheel, pip
run: python3 -m pip install -U pip setuptools wheel

- name: Checkout source
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Build distributions
run: python setup.py sdist bdist_wheel

- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
continue-on-error: true

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

0 comments on commit 82a26d3

Please sign in to comment.