Skip to content

Add yaml input file support #452

Add yaml input file support

Add yaml input file support #452

Workflow file for this run

name: Conda Build
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
workflow_dispatch:
push:
branches:
- stable
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-15-intel, macos-latest]
numpy-version: ["1.26"]
python-version: ["3.9", "3.10", "3.11"]
is_pr: ["${{ contains(github.event_name, 'pull_request') }}"]
exclude:
# for PRs just run a single build per platform to save time and resources
- is_pr: true
os: ubuntu-latest
python-version: "3.9"
- is_pr: true
os: ubuntu-latest
python-version: "3.10"
- is_pr: true
os: macos-15-intel
python-version: "3.9"
- is_pr: true
os: macos-15-intel
python-version: "3.10"
- is_pr: true
os: macos-latest
python-version: "3.9"
- is_pr: true
os: macos-latest
python-version: "3.10"
runs-on: ${{ matrix.os }}
name: Build ${{ matrix.os }} Python ${{ matrix.python-version }} Numpy ${{ matrix.numpy-version }}
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v6
- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Miniforge3
miniforge-version: latest
auto-update-conda: true
show-channel-urls: true
conda-remove-defaults: "true"
auto-activate: true
activate-environment: ""
- name: Install Build Tools
run: conda install python anaconda-client conda-build
- name: Build Binary
run: |
# set a default value to the conda_token if needed (like from forks)
: "${CONDA_TOKEN:=${{ secrets.ANACONDA_TOKEN }}}"
: "${CONDA_TOKEN:=default_value}"
echo "CONDA_TOKEN=$CONDA_TOKEN" >> $GITHUB_ENV
conda config --add channels rmg
conda config --add channels conda-forge
conda config --set anaconda_upload no
CONDA_NPY=${{ matrix.numpy-version }} CONDA_PY=${{ matrix.python-version }} conda build .
- name: Upload Built Binaries
if: >
(github.event_name == 'push' && github.ref == 'refs/heads/stable') ||
(github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/stable')
run: |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload $(conda build --output)
result:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Final Results
needs: [build]
steps:
- run: exit 1
# see https://github.com/orgs/community/discussions/26822?sort=new#discussioncomment-8285141
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}