openapi-core/.github/workflows/python-publish.yml

40 lines
1.2 KiB
YAML
Raw Normal View History

2021-01-31 12:27:40 +00:00
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
2021-02-02 13:27:18 +00:00
name: Publish python packages
2021-01-31 12:27:40 +00:00
on:
2021-02-01 22:37:58 +00:00
workflow_dispatch:
2021-01-31 12:27:40 +00:00
release:
2021-02-01 22:31:44 +00:00
types:
- created
2021-01-31 12:27:40 +00:00
jobs:
2021-02-01 22:31:44 +00:00
publish:
2021-01-31 12:27:40 +00:00
runs-on: ubuntu-latest
2021-02-01 22:00:02 +00:00
strategy:
matrix:
python-version: [2.7, 3.6]
2021-01-31 12:27:40 +00:00
steps:
- uses: actions/checkout@v2
2021-02-01 22:00:02 +00:00
- name: Set up Python ${{ matrix.python-version }}
2021-01-31 12:27:40 +00:00
uses: actions/setup-python@v2
with:
2021-02-01 22:00:02 +00:00
python-version: ${{ matrix.python-version }}
2021-01-31 12:27:40 +00:00
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
2021-02-02 13:27:18 +00:00
- name: Build
run: python setup.py sdist bdist_wheel
- name: Publish wheel
2021-01-31 12:27:40 +00:00
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2021-02-02 13:27:18 +00:00
run: twine upload dist/*.whl
- name: Publish source
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*.tar.gz || true