Skip to content

openalea/github-action-conda-build

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 

Repository files navigation

Build and Publish Anaconda Package

License: MIT

A Github workflow to build your software package and publish to an Anaconda repository.

Example workflow to build and publish to anaconda every time you make a new release

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, 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: ""

Also, note that to publish your package to your anaconda channel, you must meet one of the two following conditions :

  • have a tag that defines a new version of your package : v.... This allows uploading a new version of the package on the main anaconda channel
  • be on the main / master branch and define a label test or dev or latest (the former is recommanded). For exemple, you want to release your package on the latest channel of anaconda, only one version of python but on all os :
name: Building Package

...

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 ]"
      label: latest

About

A Github workflow to build your software package and publish to an Anaconda repository.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •