ettoreleandrotognoli/python-cdi

View on GitHub
.github/workflows/release.yml

Summary

Maintainability
Test Coverage
on:
  push:
    tags:
      - 'v*'
jobs:
  pypi-deploy:
    runs-on: ubuntu-latest
    if: startsWith(github.ref, 'refs/tags/')
    steps:
      - uses: actions/checkout@v2
      - name: Get tag name
        id: vars
        run: echo ::set-output name=tag::${GITHUB_REF#refs/*/v}
      - name: Set RELEASE_VERSION
        env:
          RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
        run: sed -i s'/^__version__ = .*/__version__ = '\'${RELEASE_VERSION}\''/' setup.py
      - name: Install dependecies
        uses: VaultVulp/action-pipenv@v2.0.1
        with:
          command: install -d
      - uses: VaultVulp/action-pipenv@v2.0.1
        with:
          command: run python setup.py sdist
      - env:
          TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
          TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
        uses: VaultVulp/action-pipenv@v2.0.1
        with:
          command: run twine upload dist/*