dmyersturnbull/service-it

View on GitHub
.github/workflows/publish.yml

Summary

Maintainability
Test Coverage
# Build, test, and publish to releases, packages, PyPi, etc.
# Runs when creating a Github release
name: Publish on release creation
on:
  release:
    types: [published]
  repository_dispatch:
    types: [release-made]
jobs:
  deploy:
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.9
      - name: Install build meta-dependencies
        run: |
          pip install poetry tox
      - name: Test with tox
        run: |
          tox -v
      - name: Build sdists and wheels with Poetry
        run: |
          poetry build
          poetry install
      - name: Attach artifacts to the Github release
        uses: skx/github-action-publish-binaries@master
        with:
          args: 'dist/*'
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Publish to PyPi
        run: |
          poetry publish -vv --username __token__ --password ${{ secrets.PYPI_TOKEN }}