diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 34d51b6137..a8131fa54e 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,12 +1,29 @@ name: publish pypi on: - push: + create: tags: - - '*' + - 'v*' workflow_dispatch: jobs: + setup_release: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Get the tag version + id: extract_branch + run: echo ::set-output name=branch::${GITHUB_REF#refs/tags/} + shell: bash + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.extract_branch.outputs.branch }} + release_name: ${{ steps.extract_branch.outputs.branch }} pypi-publish: name: Upload release to PyPI runs-on: ubuntu-latest