A Github workflow to build your software package and publish to an Anaconda repository.
This example builds your application on multiple plateforms, with multiple python versions. This is a template for your .github/workflow/build_publish_anaconda.yml
.
name: Building Package
on:
push:
branches:
- '**'
tags:
- 'v*'
pull_request:
branches:
- '**'
jobs:
build:
uses: openalea/github-action-conda-build/.github/workflows/conda-package-build.yml@main
secrets:
anaconda_token: ${{ secrets.ANACONDA_TOKEN }}
Arguments to this GH-action are set to default values, which are :
conda_directory: conda
python-minor-version: [8, 9, 10, 11, 12]
operating-system: "['ubuntu-latest', 'macos-latest', 'macos-13', 'windows-latest']"
numpy-version: 0
conda-channels: ${{ vars.ANACONDA_CHANNELS}}
build-options: "--no-test"
label: main
but you can override them in the workflow file.
For example, if you are in a dev-new-feature
branch, and you want to run the tests on ubuntu-latest
and macos-latest
, python 3.10
only, and you tag your commit with vx.x.x_dev
to upload your package to the your anaconda channel with the test
label, then your workflow file would look like this:
name: Building Package
on:
push:
branches:
- dev-new-feature
tags:
- 'v*'
pull_request:
branches:
- '**'
jobs:
build:
uses: openalea/github-action-conda-build/.github/workflows/conda-package-build.yml@main
secrets:
anaconda_token: ${{ secrets.ANACONDA_TOKEN }}
with:
python-minor-version: [ 10 ]
operating-system: '["ubuntu-latest", "macos-latest"]'
build-options: ""
label: latest