Skip to content

Commit d5c0a60

Browse files
updated CI workflow to include build to anaconda as well
1 parent 8d2b042 commit d5c0a60

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
branches:
1010
- master
1111
- dev
12+
release:
13+
types:
14+
- published
1215

1316
jobs:
1417
build:
@@ -21,10 +24,10 @@ jobs:
2124

2225
steps:
2326
- name: Check out code
24-
uses: actions/checkout@v2
27+
uses: actions/checkout@v4
2528

2629
- name: Set up Python
27-
uses: actions/setup-python@v2
30+
uses: actions/setup-python@v5
2831
with:
2932
python-version: ${{ matrix.python-version }}
3033

@@ -38,28 +41,46 @@ jobs:
3841
# stop the build if there are Python syntax errors or undefined names
3942
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
4043
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
41-
flake8 . --count --exit-zero --max-complexity=10
44+
flake8 . --count --exit-zero --max-complexity=10
4245
43-
deploy:
46+
publish:
4447
runs-on: ubuntu-latest
4548
needs: build
46-
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'release'
49+
if: github.event_name == 'release' && github.event.action == 'published'
4750
steps:
4851
- name: Check out code
49-
uses: actions/checkout@v2
52+
uses: actions/checkout@v4
5053

5154
- name: Set up Python
52-
uses: actions/setup-python@v2
55+
uses: actions/setup-python@v5
5356
with:
54-
python-version: 3.9
57+
python-version: '3.9'
5558

5659
- name: Install dependencies
5760
run: pip install setuptools wheel twine
5861

59-
- name: Build and publish
62+
- name: Build and publish to PyPI
6063
env:
6164
TWINE_USERNAME: __token__
6265
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
6366
run: |
6467
python setup.py sdist bdist_wheel
6568
twine upload dist/*
69+
70+
- name: Set up Miniconda
71+
uses: conda-incubator/setup-miniconda@v2
72+
with:
73+
auto-update-conda: true
74+
75+
- name: Install conda-build and anaconda-client
76+
run: conda install conda-build anaconda-client
77+
78+
- name: Build Conda package
79+
run: conda build conda-recipe
80+
81+
- name: Upload to Anaconda.org
82+
env:
83+
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
84+
run: |
85+
anaconda login --token $ANACONDA_TOKEN
86+
anaconda upload /home/runner/miniconda3/conda-bld/noarch/lazypredict-*.tar.bz2 --user YOUR_ANACONDA_USERNAME

0 commit comments

Comments
 (0)