Skip to content

Commit 0864aae

Browse files
Merge pull request #479 from DanielGoldfarb/master
GitHub Actions workflows to deploy package to PyPI and TestPyPI
2 parents 10095c6 + c17543b commit 0864aae

File tree

3 files changed

+86
-26
lines changed

3 files changed

+86
-26
lines changed

.github/workflows/pubPyPI.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Upload Mplfinance to PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'version tag to deploy'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
build_and_deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v2
17+
with:
18+
ref: ${{ github.event.inputs.tag }}
19+
20+
- name: Display Coded Version
21+
#run: git show ${{ github.sha }}:src/mplfinance/_version.py
22+
run: egrep 'version_info .*=' src/mplfinance/_version.py
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: '3.x'
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install setuptools wheel twine
33+
34+
- name: Build
35+
run: |
36+
python setup.py sdist bdist_wheel
37+
ls -l dist/*
38+
39+
- name: Publish distribution to PyPI
40+
env:
41+
TWINE_USERNAME: __token__
42+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
43+
run: twine upload dist/*

.github/workflows/pubTestPyPI.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Upload Mplfinance to TestPyPI
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'version tag to deploy'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
build_and_deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v2
17+
with:
18+
ref: ${{ github.event.inputs.tag }}
19+
20+
- name: Display Coded Version
21+
#run: git show ${{ github.sha }}:src/mplfinance/_version.py
22+
run: egrep 'version_info .*=' src/mplfinance/_version.py
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: '3.x'
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install setuptools wheel twine
33+
34+
- name: Build
35+
run: |
36+
python setup.py sdist bdist_wheel
37+
ls -l dist/*
38+
39+
- name: Publish distribution to Test PyPI
40+
env:
41+
TWINE_USERNAME: __token__
42+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
43+
run: twine upload --repository-url https://test.pypi.org/legacy/ dist/*

.github/workflows/pythonpublish.yml

-26
This file was deleted.

0 commit comments

Comments
 (0)