Skip to content

Commit

Permalink
Add conda builds to our github actions workflow
Browse files Browse the repository at this point in the history
This adds a conda build step to build our conda package to the github actions workflow.
This also uploads the package to anaconda during release.
  • Loading branch information
benfred committed May 19, 2022
1 parent cb1e67d commit b30e0a9
Showing 1 changed file with 38 additions and 4 deletions.
42 changes: 38 additions & 4 deletions .github/workflows/cpu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.8]
python-version: [3.7, 3.8, 3.9]
os: [ubuntu-latest]

steps:
Expand Down Expand Up @@ -62,11 +62,27 @@ jobs:
- name: Generate package for pypi
run: |
python setup.py sdist
- name: Upload artifacts to github
- name: Upload pypi artifacts to github
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
- name: Generate package for conda
id: conda_build
run: |
conda update conda
conda install conda-build pybind11
conda build --python ${{ matrix.python-version }} . -c defaults -c conda-forge -c numba -c rapidsai -c nvidia --output-folder ./conda_packages
export CONDA_PACKAGE=$(conda build --python ${{ matrix.python-version }} . -c defaults -c conda-forge -c numba -c rapidsai -c nvidia --output-folder ./conda_packages --output)
echo "conda_package : $CONDA_PACKAGE"
echo "::set-output name=conda_package::$CONDA_PACKAGE"
- name: Upload conda artifacts to github
uses: actions/upload-artifact@v2
with:
name: conda
path: ${{ steps.conda_build.outputs.conda_package }}

# Build docs, treat warnings as errors
- name: Building docs
run: |
Expand Down Expand Up @@ -99,10 +115,11 @@ jobs:
- uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Create GitHub Release
uses: fnkr/[email protected]
env:
GHR_PATH: .
GHR_PATH: ./dist
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v2
with:
Expand All @@ -113,4 +130,21 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install --upgrade wheel pip setuptools twine
twine upload *
twine upload dist/*
- uses: actions/download-artifact@v2
with:
name: conda
path: conda
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
- name: Install conda dependencies
shell: bash -l {0}
run: |
conda install -y anaconda-client conda-build
- name: Push to anaconda
shell: bash -l {0}
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
anaconda -t $ANACONDA_TOKEN upload -u nvidia conda/*.tar.bz2

0 comments on commit b30e0a9

Please sign in to comment.