Skip to content

gh-actions: fix release action #21

gh-actions: fix release action

gh-actions: fix release action #21

name: Build and release
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
Test:
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- python: python3
pip: pip3
- python: python2
pip: pip
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install python dependencies
run: |
${{ matrix.pip }} install --user --upgrade pip
${{ matrix.pip }} --no-cache-dir install --user setuptools wheel py coveralls
${{ matrix.pip }} --no-cache-dir install --user -e .[tests]
- name: Show python dependencies
run: |
${{ matrix.python }} --version
${{ matrix.pip }} freeze
- name: Run tests
uses: ./.github/actions/run-tests
Release:
if: ${{ github.event_name == 'push' }}
needs: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install python dependencies
run: |
pip3 install --user --upgrade pip
pip3 --no-cache-dir install --user setuptools wheel py coveralls
pip3 --no-cache-dir install --user -e .[tests]
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish package
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}