diff --git a/.github/workflows/pubPyPI.yml b/.github/workflows/pubPyPI.yml new file mode 100644 index 00000000..675c4249 --- /dev/null +++ b/.github/workflows/pubPyPI.yml @@ -0,0 +1,43 @@ +name: Upload Mplfinance to PyPI + +on: + workflow_dispatch: + inputs: + tag: + description: 'version tag to deploy' + required: true + type: string + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + with: + ref: ${{ github.event.inputs.tag }} + + - name: Display Coded Version + #run: git show ${{ github.sha }}:src/mplfinance/_version.py + run: egrep 'version_info .*=' src/mplfinance/_version.py + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + + - name: Build + run: | + python setup.py sdist bdist_wheel + ls -l dist/* + + - name: Publish distribution to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: twine upload dist/* diff --git a/.github/workflows/pubTestPyPI.yml b/.github/workflows/pubTestPyPI.yml new file mode 100644 index 00000000..ed5e2814 --- /dev/null +++ b/.github/workflows/pubTestPyPI.yml @@ -0,0 +1,43 @@ +name: Upload Mplfinance to TestPyPI + +on: + workflow_dispatch: + inputs: + tag: + description: 'version tag to deploy' + required: true + type: string + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + with: + ref: ${{ github.event.inputs.tag }} + + - name: Display Coded Version + #run: git show ${{ github.sha }}:src/mplfinance/_version.py + run: egrep 'version_info .*=' src/mplfinance/_version.py + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + + - name: Build + run: | + python setup.py sdist bdist_wheel + ls -l dist/* + + - name: Publish distribution to Test PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }} + run: twine upload --repository-url https://test.pypi.org/legacy/ dist/* diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml deleted file mode 100644 index 21f2f01d..00000000 --- a/.github/workflows/pythonpublish.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Upload Python Package - -on: - release: - types: [created] - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/*