Skip to content

Commit

Permalink
Move publish to PyPI job to own workflow triggered by creation of rel…
Browse files Browse the repository at this point in the history
…ease
  • Loading branch information
zerolab committed Jun 19, 2021
1 parent 87e956a commit 049cc1e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 23 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: CI
on:
push:
branches: [main]
tags: v[0-9]+.[0-9]+.[0-9]+
pull_request:
branches: [main]

Expand Down Expand Up @@ -56,25 +55,3 @@ jobs:
if: ${{ matrix.toxenv == 'djangomain' }}
continue-on-error: ${{ matrix.experimental }}
run: tox -e ${{ matrix.toxenv }}

build_and_publish:
if: startsWith(github.ref, 'refs/tags/v')
needs: [lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install dependencies
run: pip install wheel
- name: Build
run: python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish to PyPI

on:
release:
types: [released, prereleased]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: '__token__'
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 049cc1e

Please sign in to comment.