Skip to content

Commit

Permalink
Merge pull request shankarpandala#471 from shankarpandala/dev
Browse files Browse the repository at this point in the history
changed way of releasing package
  • Loading branch information
shankarpandala authored Nov 1, 2024
2 parents 8215e2a + c52d411 commit efebfd2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,49 @@
# This workflow will upload a python package uing twine when a release is triggered

name: publish

on:
release:
types: [created]

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
- 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
13 changes: 0 additions & 13 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
[bumpversion]
current_version = 0.2.12
commit = True
tag = True

[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'

[bumpversion:file:lazypredict/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'

[bdist_wheel]
universal = 1

Expand Down

0 comments on commit efebfd2

Please sign in to comment.