Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated way of releasing #472

Merged
merged 24 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5923c38
Changed authentication to OpenID
shankarpandala Nov 1, 2024
4e9bd2c
updated code for OIDC
shankarpandala Nov 1, 2024
8a875a0
fixes to publishing
shankarpandala Nov 1, 2024
7fe86c6
fixed issues with conda publishing
shankarpandala Nov 1, 2024
0bfa89d
check if pypi release is already done
shankarpandala Nov 1, 2024
ad1c53a
fix conda publishing issues
shankarpandala Nov 1, 2024
accc840
fixed conda build issues
shankarpandala Nov 1, 2024
a28725a
updated to use fcakyon/[email protected]
shankarpandala Nov 2, 2024
afa7f01
updated publish to conda
shankarpandala Nov 2, 2024
239e172
refactor workflow to build conda package directly and clean up unused…
shankarpandala Nov 2, 2024
3eeb495
fix workflow to use correct Conda activation path and ensure proper p…
shankarpandala Nov 2, 2024
21a4049
add conda recipe for lazypredict package
shankarpandala Nov 2, 2024
fc5bb7e
add pytest-runner to conda recipe and requirements
shankarpandala Nov 2, 2024
34a565e
moved meta.yaml to root directory
shankarpandala Nov 2, 2024
0f30851
update publish workflow to install Git and adjust conda build command
shankarpandala Nov 2, 2024
f7f964e
move lazypredict conda recipe from meta.yaml to conda-recipe directory
shankarpandala Nov 2, 2024
7058b4a
add meta.yaml for lazypredict package with build and runtime requirem…
shankarpandala Nov 2, 2024
c425178
refactor CI workflows: remove Conda build steps and add pytest testing
shankarpandala Nov 2, 2024
4126981
update README: replace Travis CI badge with GitHub Actions publish badge
shankarpandala Nov 2, 2024
b3daea2
update CI workflows: streamline testing process and enhance build eff…
shankarpandala Nov 2, 2024
bcb01bf
add unit tests for CLI and supervised learning components
shankarpandala Nov 2, 2024
947c87f
update CI workflow: install requirements before running tests and upd…
shankarpandala Nov 2, 2024
ff0b119
update README: replace Boston dataset with Diabetes dataset and adjus…
shankarpandala Nov 2, 2024
fbce49e
update CI workflow: enhance documentation build process and upgrade a…
shankarpandala Nov 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 4 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,44 +43,8 @@ jobs:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10

publish:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Install dependencies
run: pip install setuptools wheel twine

- name: Build and publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true

- name: Install conda-build and anaconda-client
run: conda install conda-build anaconda-client

- name: Build Conda package
run: conda build conda-recipe

- name: Upload to Anaconda.org
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
- name: Test with pytest
run: |
anaconda login --token $ANACONDA_TOKEN
anaconda upload /home/runner/miniconda3/conda-bld/noarch/lazypredict-*.tar.bz2 --user YOUR_ANACONDA_USERNAME
python -m pip install -r requirements.txt
python -m pip install pytest
pytest || true
69 changes: 41 additions & 28 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,48 @@
name: "Pull Request Docs Check"
on:
- pull_request
pull_request:

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"

- uses: actions/upload-artifact@v3
with:
name: DocumentationHTML
path: docs/_build/html/

- name: Commit documentation changes
run: |
git clone https://github.com/your_git/repository.git --branch gh-pages --single-branch gh-pages
cp -r docs/_build/html/* gh-pages/
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore
# the return code.
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2 # Updated to v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x' # Specify the Python version you need

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx
pip install -r docs/requirements.txt # Ensure you have a requirements file for Sphinx

- name: Build documentation
run: |
sphinx-build docs docs/_build/html

- uses: actions/upload-artifact@v3
with:
name: DocumentationHTML
path: docs/_build/html/

- name: Commit documentation changes
run: |
git clone https://github.com/shankarpandala/lazypredict.git --branch gh-pages --single-branch gh-pages
cp -r docs/_build/html/* gh-pages/
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore
# the return code.

- name: Push changes
uses: ad-m/[email protected] # Updated to a specific version
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
75 changes: 35 additions & 40 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,44 @@
name: publish
name: Publish

on:
release:
types: [created]

permissions:
contents: read
id-token: write # Required for OIDC

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Get release version
id: get_version
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"

- name: Update version in setup.py
run: |
sed -i "s/version='.*'/version='${{ steps.get_version.outputs.version }}'/g" setup.py
sed -i "s/__version__ = '.*'/__version__ = '${{ steps.get_version.outputs.version }}'/g" lazypredict/__init__.py

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine

- name: Build and publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERS }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

- name: Build Conda Package
run: |
conda install conda-build
conda-build conda-recipe

- name: Upload Conda Package
run: |
anaconda login --username ${{ secrets.ANACONDA_USERNAME }} --password ${{ secrets.ANACONDA_TOKEN }}
anaconda upload /path/to/your/conda-package.tar.bz2 # Update with actual path
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install Build Tools and Git
run: |
sudo apt-get update
sudo apt-get install -y git
python -m pip install --upgrade pip
pip install build

- name: Update Version in setup.py and __init__.py
run: |
VERSION=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
sed -i "s/version=.*/version='$VERSION',/" setup.py
sed -i "s/__version__ = .*/__version__ = '$VERSION'/" lazypredict/__init__.py

- name: Build Package
run: python -m build

- name: Publish to PyPI
if: github.event.release.prerelease == false
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: 'https://upload.pypi.org/legacy/'
Loading
Loading