Enable cpp code path for Categorify
ops
#225
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Packages | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- release* | |
tags: | |
- v* | |
pull_request: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-pypi: | |
name: Build PyPI Package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install and upgrade python packages | |
run: | | |
python -m pip install --upgrade pip setuptools==59.4.0 wheel | |
- name: Generate package for pypi | |
run: | | |
python setup.py sdist | |
- name: Upload pypi artifacts to github | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
build-conda: | |
name: Build Conda Package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
- name: Generate package for conda | |
id: conda_build | |
run: | | |
echo "conda pkgs dir $CONDA_PKGS_DIRS" | |
conda install -c conda-forge mamba | |
mamba install -c conda-forge conda-build boa conda-verify | |
conda mambabuild . -c defaults -c conda-forge -c numba -c rapidsai -c nvidia --output-folder ./conda_packages | |
conda_package=$(find ./conda_packages/ -name "*.tar.bz2") | |
export CONDA_PACKAGE=$conda_package | |
echo "conda_package : $conda_package" | |
echo "conda_package=$conda_package" >> "$GITHUB_OUTPUT" | |
- name: Upload conda artifacts to github | |
uses: actions/upload-artifact@v3 | |
with: | |
name: conda | |
path: ${{ steps.conda_build.outputs.conda_package }} | |
release-pypi: | |
name: Release PyPI Package | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/')" | |
needs: [build-pypi] | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- name: Create GitHub Release | |
uses: fnkr/[email protected] | |
env: | |
GHR_PATH: ./dist | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Push to PyPI | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
pip install --upgrade wheel pip setuptools twine | |
twine upload dist/* | |
release-conda: | |
name: Release Conda Package | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/')" | |
needs: [build-conda] | |
steps: | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- uses: actions/download-artifact@v3 | |
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 |