From 508ed24f284613361d2e83a24bf84dd791d2c390 Mon Sep 17 00:00:00 2001 From: Daniel Goldfarb Date: Sat, 11 Dec 2021 18:58:10 -0500 Subject: [PATCH 1/2] Add publishTestPyPI and publishPyPI workflows. add input requirement checkout based on input reference test cat _version.py file test publish use publish v1 (instead of release/v1), and p3.x instead of p3.9 apparently @release/v1 is needed (not just @v1) now try twine publishTestPyPI and publishPyPI workflows --- .github/workflows/publishPyPI.yml | 43 +++++++++++++++++++++++++++ .github/workflows/publishTestPyPI.yml | 43 +++++++++++++++++++++++++++ .github/workflows/pythonpublish.yml | 26 ---------------- 3 files changed, 86 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/publishPyPI.yml create mode 100644 .github/workflows/publishTestPyPI.yml delete mode 100644 .github/workflows/pythonpublish.yml diff --git a/.github/workflows/publishPyPI.yml b/.github/workflows/publishPyPI.yml new file mode 100644 index 00000000..8e045a37 --- /dev/null +++ b/.github/workflows/publishPyPI.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 + + - 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/publishTestPyPI.yml b/.github/workflows/publishTestPyPI.yml new file mode 100644 index 00000000..fd0c704c --- /dev/null +++ b/.github/workflows/publishTestPyPI.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 + + - 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/* From c17543bd3ae80f444786b92d31a4cd5305ab896d Mon Sep 17 00:00:00 2001 From: Daniel Goldfarb Date: Mon, 13 Dec 2021 15:54:23 -0500 Subject: [PATCH 2/2] fix typo; and rename files --- .github/workflows/{publishPyPI.yml => pubPyPI.yml} | 2 +- .github/workflows/{publishTestPyPI.yml => pubTestPyPI.yml} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{publishPyPI.yml => pubPyPI.yml} (98%) rename .github/workflows/{publishTestPyPI.yml => pubTestPyPI.yml} (98%) diff --git a/.github/workflows/publishPyPI.yml b/.github/workflows/pubPyPI.yml similarity index 98% rename from .github/workflows/publishPyPI.yml rename to .github/workflows/pubPyPI.yml index 8e045a37..675c4249 100644 --- a/.github/workflows/publishPyPI.yml +++ b/.github/workflows/pubPyPI.yml @@ -11,7 +11,7 @@ on: jobs: build_and_deploy: runs-on: ubuntu-latest - + steps: - name: Checkout Repository uses: actions/checkout@v2 with: diff --git a/.github/workflows/publishTestPyPI.yml b/.github/workflows/pubTestPyPI.yml similarity index 98% rename from .github/workflows/publishTestPyPI.yml rename to .github/workflows/pubTestPyPI.yml index fd0c704c..ed5e2814 100644 --- a/.github/workflows/publishTestPyPI.yml +++ b/.github/workflows/pubTestPyPI.yml @@ -11,7 +11,7 @@ on: jobs: build_and_deploy: runs-on: ubuntu-latest - + steps: - name: Checkout Repository uses: actions/checkout@v2 with: