# Match release tags on master branch
name: Manual-Release

on:
  workflow_dispatch:
    inputs:
      publish:
        description: 'Publish manual release to PyPI'
        default: false

jobs:
  release:
    runs-on: ubuntu-latest
    name: Build release package

    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-python@master
        name: Setup Python 3.8
        with:
          python-version: 3.8

      - name: Install dependencies
        run: python -m pip install -U poetry
         
      - name: Build Package
        id: build_package
        run: |
          rm -rf dist
          poetry build
          cd dist
          echo "::set-output name=source::$(ls *.tar.gz)"
          echo "::set-output name=wheel::$(ls *.whl)"
          echo "::set-output name=version::$(poetry version -s)"
      
      - name: Create a Release
        id: create_release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ steps.build_package.outputs.version }}
          release_name: Release ${{ steps.build_package.outputs.version }}
          prerelease: false

      - name: Attach Release Wheel
        uses: actions/upload-release-asset@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ steps.create_release.outputs.upload_url }}
          asset_path: ./dist/${{ steps.build_package.outputs.wheel }}
          asset_name: ${{ steps.build_package.outputs.wheel }}
          asset_content_type: application/x-pywheel+zip

      - name: Attach Release Source
        uses: actions/upload-release-asset@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ steps.create_release.outputs.upload_url }}
          asset_path: ./dist/${{ steps.build_package.outputs.source }}
          asset_name: ${{ steps.build_package.outputs.source }}
          asset_content_type: application/x-tar+gzip

Add manual release flow for pre-releases from develop
Add manual release flow for pre-releases from develop
