🐍 Build and upload Conda packages #96
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: "🐍 Build and upload Conda packages" | |
on: | |
workflow_dispatch: | |
jobs: | |
conda-deploy: | |
name: Building conda package for python ${{ matrix.os }}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}} | |
steps: | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/checkout@v4 | |
- name: update submodules | |
run: | | |
git submodule update --init --recursive | |
- name: Conda build | |
env: | |
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
shell: bash -l {0} | |
run: | | |
conda install -c conda-forge conda-build scikit-build numpy cython anaconda-client conda-libmamba-solver -y | |
conda build -c conda-forge -c loop3d --output-folder conda conda --python ${{matrix.python-version}} | |
conda convert -p all conda/linux-64/*.tar.bz2 -f -o conda | |
- name: upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: conda-build-${{ matrix.python-version }} | |
path: conda | |
upload_to_conda: | |
runs-on: ubuntu-latest | |
needs: conda-deploy | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}} | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: conda-build-${{ matrix.python-version }} | |
path: conda | |
- uses: conda-incubator/setup-miniconda@v3 | |
- name: upload all files to conda-forge | |
shell: bash -l {0} | |
env: | |
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
run: | | |
conda install -c anaconda anaconda-client -y | |
anaconda upload --label main conda/*/*.tar.bz2 | |