diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76ab2df..29010bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,12 +4,14 @@ on: push: branches: - main + tags: + - v* pull_request: branches: - main jobs: - publish: + build-and-push-package: runs-on: ubuntu-latest steps: @@ -20,11 +22,11 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.8 - + - name: Set up FFmpeg uses: FedericoCarboni/setup-ffmpeg@v2 - - - name: Install Additional Requirements + + - name: Install Additional requirements run: | sudo apt-get -y install portaudio19-dev wget shell: bash @@ -35,13 +37,16 @@ jobs: - name: Install Server Requirements run: pip install -r requirements/server.txt - - name: Install Wheel for Build + - name: Install Wheel for build run: pip install wheel twine - - - name: Build and Publish Package to PyPI + + - name: Build wheel run: | python setup.py sdist bdist_wheel - twine upload --repository-url https://upload.pypi.org/legacy/ dist/* - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + + - name: Push package on Test PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}