Skip to content

Build_PYPI_Latest

Build_PYPI_Latest #114

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# Connect to the PYPI
# documentation for pyDRTtools
name: Build_Dist_y2
on:
workflow_dispatch:
jobs:
python-build-n-publish:
name: Build and publish Python distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Initialize Python #3.9
uses: actions/setup-python@v3
with:
python-version: "3.x" #3.9 ## Set yp python 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install setuptools matplotlib PyQt5 pandas scipy numpy scikit-learn wheel
#pip install -r requirement.txt ### new code addded
# Use flake8 to wrap source code into package/ python library
- name: Lint with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics ## Linting operations
#
- name: Build binary wheel and a source tarball
run: python setup.py sdist # Execute setup file python -m build --sdist --wheel --outdir dist
- name: Build binary distribution
run: python setup.py bdist_wheel
# - name: Publish distribution to TestPYPI
# uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
# #pypa/gh-action-pypi-publish@master ## PYDRTTOOLSTEST
# with:
# password: ${{ secrets.PYDRTTOOLSTEST }}
# repository_url: https://test.pypi.org/legacy/
- name: Publish to PYPI
#if: github.event_name == 'release' # Only publish to PyPI on release events
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
password: ${{ secrets.PYDRTTOOLSAPI }}
repository_url: https://upload.pypi.org/legacy/