Skip to content

Commit c52d411

Browse files
changed way of releasing package
1 parent a0431ba commit c52d411

File tree

2 files changed

+24
-17
lines changed

2 files changed

+24
-17
lines changed

.github/workflows/publish.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,49 @@
1-
# This workflow will upload a python package uing twine when a release is triggered
2-
31
name: publish
42

53
on:
64
release:
75
types: [created]
8-
6+
97
jobs:
108
deploy:
119
runs-on: ubuntu-latest
1210

1311
steps:
1412
- uses: actions/checkout@v2
13+
1514
- name: Set up Python
1615
uses: actions/setup-python@v2
1716
with:
1817
python-version: '3.x'
18+
19+
- name: Get release version
20+
id: get_version
21+
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
22+
23+
- name: Update version in setup.py
24+
run: |
25+
sed -i "s/version='.*'/version='${{ steps.get_version.outputs.version }}'/g" setup.py
26+
sed -i "s/__version__ = '.*'/__version__ = '${{ steps.get_version.outputs.version }}'/g" lazypredict/__init__.py
27+
1928
- name: Install dependencies
2029
run: |
2130
python -m pip install --upgrade pip
2231
pip install setuptools wheel twine
23-
- name: Build and publish
32+
33+
- name: Build and publish to PyPI
2434
env:
2535
TWINE_USERNAME: ${{ secrets.PYPI_USERS }}
2636
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2737
run: |
2838
python setup.py sdist bdist_wheel
2939
twine upload dist/*
40+
41+
- name: Build Conda Package
42+
run: |
43+
conda install conda-build
44+
conda-build conda-recipe
45+
46+
- name: Upload Conda Package
47+
run: |
48+
anaconda login --username ${{ secrets.ANACONDA_USERNAME }} --password ${{ secrets.ANACONDA_TOKEN }}
49+
anaconda upload /path/to/your/conda-package.tar.bz2 # Update with actual path

setup.cfg

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
[bumpversion]
2-
current_version = 0.2.12
3-
commit = True
4-
tag = True
5-
6-
[bumpversion:file:setup.py]
7-
search = version='{current_version}'
8-
replace = version='{new_version}'
9-
10-
[bumpversion:file:lazypredict/__init__.py]
11-
search = __version__ = '{current_version}'
12-
replace = __version__ = '{new_version}'
13-
141
[bdist_wheel]
152
universal = 1
163

0 commit comments

Comments
 (0)