Skip to content

Python versipn patch 1 #157

Python versipn patch 1

Python versipn patch 1 #157

Workflow file for this run

name: Publish
on:
release:
types: [created]
push:
branches: [dev]
pull_request:
branches: [master]
create:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest setuptools wheel twine build
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Get release version
id: get_version
run: echo "::set-output name=VERSION::${GITHUB_REF#refs/tags/}"
- name: Build and test
run: |
echo "Building package with version ${{ steps.get_version.outputs.VERSION }}"
sed -i "s/version='0.0.0'/version='${{ steps.get_version.outputs.VERSION }}'/" setup.py
python -m build
pip install dist/article_parser-*.whl
pytest --disable-warnings
# - name: Test Publish
# uses: pypa/gh-action-pypi-publish@release/v1
# if: github.event_name == 'release' && github.event.action == 'created'
# with:
# user: __token__
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository-url: https://test.pypi.org/legacy/
# skip-existing: true
# verbose: true
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'create' && github.event.ref_type == 'tag'
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip-existing: true
verbose: true