Generate non periodical conda packages #1
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: Generate non periodical conda packages | |
# This action automatically generate conda packages for the packages in the robotology-superbuild | |
# Check doc/conda-recipe-generation.md for more info | |
on: | |
workflow_dispatch: | |
inputs: | |
upload_conda_binaries: | |
description: 'If true, upload conda binaries, for any other value only generate them without uploading.' | |
required: true | |
default: 'true' | |
jobs: | |
generate-non-periodical-conda-packages: | |
name: "Generate non-periodical conda packages @${{ matrix.os }}" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
conda_platform: linux-64 | |
- os: macos-11.0 | |
conda_platform: osx-64 | |
- os: windows-2019 | |
conda_platform: win-64 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-variant: Miniforge3 | |
miniforge-version: latest | |
- name: Dependencies for conda recipes generation and upload | |
shell: bash -l {0} | |
run: | | |
conda install pyyaml jinja2 conda-build ninja anaconda-client conda-forge-pinning mamba boa multisheller | |
- name: Print used environment | |
shell: bash -l {0} | |
run: | | |
conda list | |
env | |
- name: Build conda packages | |
shell: bash -l {0} | |
run: | | |
conda config --remove channels defaults | |
conda config --env --set channel_priority strict | |
cd conda/non_periodical_recipes | |
# We use the conda_build_config from conda-forge-pinning, and our local one | |
# See https://docs.conda.io/projects/conda-build/en/latest/resources/variants.html#creating-conda-build-variant-config-files | |
# We manually specify the build order as an old workaround for mambabuild, in theory this can be avoided, but it needs to be tested | |
# see https://github.com/mamba-org/boa/issues/117 | |
# We also manually delete the recipe directory to avoid that it is built again, | |
# specifically because we can't use --skip-existing as these packages are part of the robotology channel | |
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml . | |
- name: Upload conda packages | |
shell: bash -l {0} | |
# Upload by default on schedule events, and on workflow dispatch only if input upload_conda_binaries is 'true' | |
if: (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_conda_binaries == 'true') | |
env: | |
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }} | |
run: | | |
cd ${CONDA_PREFIX}/conda-bld/${{ matrix.conda_platform}}/ | |
ls *.tar.bz2 | |
anaconda upload --skip-existing *.tar.bz2 | |
# Only on linux-64 we upload noarch packages (noarch packages need to be uploaded only once, as they can be reused across platforms) | |
- name: Upload conda packages (noarch) | |
shell: bash -l {0} | |
# Upload by default on schedule events, and on workflow dispatch only if input upload_conda_binaries is 'true' | |
if: matrix.conda_platform == 'linux-64' && (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_conda_binaries == 'true') | |
env: | |
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }} | |
run: | | |
cd ${CONDA_PREFIX}/conda-bld/noarch/ | |
ls *.tar.bz2 | |
anaconda upload --skip-existing *.tar.bz2 |