Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish to pypi only once in github actions #47

Merged
merged 3 commits into from
Mar 21, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ name: Python package

on: [push, pull_request]

env:
target_python_version: 3.8

jobs:
build:
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: [3.7, 3.8]
python-version: [3.7, "${{env.target_python_version}}"]

steps:
- uses: actions/checkout@v1
Expand All @@ -19,13 +22,28 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions wheel
pip install tox tox-gh-actions
- name: Test with tox
run: tox

publish:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{env.target_python_version}}
uses: actions/setup-python@v2
with:
python-version: ${{env.target_python_version}}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
- name: Build distributions
run: python setup.py sdist bdist_wheel --universal
- name: Upload release to pypi
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/[email protected]
uses: pypa/[email protected]
with:
password: ${{ secrets.pypi_password }}
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,7 @@ History
------------------
* Support newer openwrt snapshot versions (#45)
* Fix tox in github actions and also test py38 (#46)

1.1.x (unreleased)
------------------
* Publish to pypi only once in github actions (#47)