Skip to content

Commit

Permalink
Merge pull request #479 from DanielGoldfarb/master
Browse files Browse the repository at this point in the history
GitHub Actions workflows to deploy package to PyPI and TestPyPI
  • Loading branch information
DanielGoldfarb authored Dec 13, 2021
2 parents 10095c6 + c17543b commit 0864aae
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 26 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/pubPyPI.yml
Original file line number Diff line number Diff line change
@@ -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/*
43 changes: 43 additions & 0 deletions .github/workflows/pubTestPyPI.yml
Original file line number Diff line number Diff line change
@@ -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/*
26 changes: 0 additions & 26 deletions .github/workflows/pythonpublish.yml

This file was deleted.

0 comments on commit 0864aae

Please sign in to comment.