diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 5f4892c..b7be75b 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -1,6 +1,10 @@ name: Python Package using Conda -on: [push, pull_request] +on: + push: + tags: + - 'v*.*.*' # Trigger on version tags like v1.0.0 + pull_request: jobs: build-linux: @@ -52,6 +56,42 @@ jobs: python -m pip install pytest pytest-xdist pytest -n auto # Utilize all available CPU cores for testing + - name: Build Conda Package + run: | + conda install conda-build + conda build . # Build Conda package + + - name: Publish to PyPI + if: github.ref_type == 'tag' # Only publish on tagged releases + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python -m pip install --upgrade twine + twine upload dist/* # Upload package to PyPI + + - name: Publish to Anaconda + if: github.ref_type == 'tag' + env: + ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} + run: | + conda install anaconda-client + anaconda login --token $ANACONDA_TOKEN + anaconda upload path/to/your-package.tar.bz2 # Update with actual package path + + - name: Clean up workspace + run: | + find . -name "*.so" -delete + find . -name "*.c" -delete + find . -name "*.cpp" -delete + + - name: Upload pytest results + if: failure() # Executes only if previous steps fail + uses: actions/upload-artifact@v3 + with: + name: pytest-results + path: ./.pytest_cache/ + - name: Debugging Information if: failure() # Executes only if previous steps fail run: | diff --git a/.gitignore b/.gitignore index 82f9275..cdcf683 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +.pypirc # PyInstaller # Usually these files are written by a python script from a template diff --git a/doc/source/index.rst b/doc/source/index.rst index 920d346..af42826 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -89,7 +89,7 @@ function to ensure the model’s proper operation in various machine learning workflows: - **installation**: - This subpackage provides all the necessary instructions to :ref:` install ` and + This subpackage provides all the necessary instructions to :ref:`install ` and configure the `hwm` package. It includes detailed steps for setting up dependencies and environment requirements, ensuring users can get started quickly and without hassle. It also includes troubleshooting tips for common