push package only on new tag
This commit is contained in:
@@ -4,12 +4,14 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
build-and-push-package:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -24,7 +26,7 @@ jobs:
|
|||||||
- name: Set up FFmpeg
|
- name: Set up FFmpeg
|
||||||
uses: FedericoCarboni/setup-ffmpeg@v2
|
uses: FedericoCarboni/setup-ffmpeg@v2
|
||||||
|
|
||||||
- name: Install Additional Requirements
|
- name: Install Additional requirements
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get -y install portaudio19-dev wget
|
sudo apt-get -y install portaudio19-dev wget
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -35,13 +37,16 @@ jobs:
|
|||||||
- name: Install Server Requirements
|
- name: Install Server Requirements
|
||||||
run: pip install -r requirements/server.txt
|
run: pip install -r requirements/server.txt
|
||||||
|
|
||||||
- name: Install Wheel for Build
|
- name: Install Wheel for build
|
||||||
run: pip install wheel twine
|
run: pip install wheel twine
|
||||||
|
|
||||||
- name: Build and Publish Package to PyPI
|
- name: Build wheel
|
||||||
run: |
|
run: |
|
||||||
python setup.py sdist bdist_wheel
|
python setup.py sdist bdist_wheel
|
||||||
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
|
|
||||||
env:
|
- name: Push package on Test PyPI
|
||||||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
|
||||||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
with:
|
||||||
|
user: __token__
|
||||||
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user