Publish to Anaconda.org #248
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: | |
os: [ubuntu-latest, windows-latest] | |
python-version: ['3.10'] | |
# python-version: ['3.10', '3.11', '3.12'] | |
# os: [ubuntu-latest, windows-latest, macOS-14] | |
include: | |
- python-version: 3.9 | |
os: windows-latest | |
defaults: # https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup miniconda # https://github.com/marketplace/actions/setup-miniconda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
channels: conda-forge,ncb | |
python-version: 3.12 | |
auto-activate-base: false | |
activate-environment: anaconda-client-env | |
environment-file: build_env.yml | |
condarc-file: condarc.yml | |
- name: Build and upload to anaconda | |
run: | | |
mkdir build | |
conda build conda/xarray-behave --no-anaconda-upload --python ${{ matrix.python-version }} --output-folder build | |
env: | |
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
- name: Test package | |
shell: bash -l {0} | |
run: | | |
conda deactivate | |
conda create -n xb_test xarray_behave=0.35.7 -c local -c conda-forge -c ncb -c build -y | |
python -m "import xarray_behave; print(xarray_behave.__version__)" | |