Skip to content

publish

publish #15

Workflow file for this run

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: publish
on:
push:
tags:
- "*"
workflow_dispatch:
inputs:
tag_name:
description: 'Tag Name'
required: true
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Set up poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.4
- name: Install Dependencies
run: poetry install --with dev
- name: Lint with pylint
run: |
poetry run pylint $(git ls-files '*.py')
- name: Test with pytest
run: |
poetry run pytest src test
- name: Build package
run: poetry build
- name: create release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
tag: ${{ github.event.inputs.tag_name }}
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}