Publish to Anaconda.org #163
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: Publish to Anaconda.org | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
tags: | |
description: 'manual run' | |
jobs: | |
publish: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: False | |
matrix: | |
python-version: [3.9 , '3.10', '3.11'] | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
defaults: # https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup miniconda # https://github.com/marketplace/actions/setup-miniconda | |
uses: conda-incubator/[email protected] | |
with: | |
auto-update-conda: true | |
miniforge-variant: Mambaforge | |
channels: conda-forge,ncb,anaconda,defaults | |
python-version: 3.9 | |
mamba-version: "*" | |
auto-activate-base: false | |
activate-environment: anaconda-client-env | |
environment-file: build_env.yml | |
condarc-file: condarc.yml | |
use-mamba: true | |
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | |
- name: Build and upload to anaconda | |
run: | | |
conda mambabuild conda/xarray-behave -c conda-forge -c ncb -c anaconda --python ${{ matrix.python-version }} --user ncb --token $ANACONDA_TOKEN | |
env: | |
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} |