Skip to content

Fix Conda build workflow #100

Fix Conda build workflow

Fix Conda build workflow #100

Workflow file for this run

name: Conda Build
on:
pull_request:
push:
branches:
- stable
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
# Step to create a custom condarc.yml before setting up conda
- name: Create custom conda config file
run: |
RUNNER_CWD=$(pwd)
echo "channels:" > $RUNNER_CWD/condarc.yml
echo " - conda-forge" >> $RUNNER_CWD/condarc.yml
echo "show_channel_urls: true" >> $RUNNER_CWD/condarc.yml
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Miniforge3
miniforge-version: latest
use-mamba: true
condarc-file: condarc.yml
auto-update-conda: false
auto-activate-base: true
activate-environment: ""
- name: Install Build Tools
run: mamba install python anaconda-client conda-build
- name: Configure Auto-Upload
if: github.ref == 'refs/heads/stable'
run: |
mamba config --set anaconda_upload yes
- name: Build Binary
run: |
# Set the CONDA_TOKEN environment variable
if [ -z "${{ secrets.ANACONDA_TOKEN }}" ]; then
export CONDA_TOKEN="default_value"
else
export CONDA_TOKEN="${{ secrets.ANACONDA_TOKEN }}"
fi
echo "Using CONDA_TOKEN=${CONDA_TOKEN}"
echo "CONDA_TOKEN=$CONDA_TOKEN" >> $GITHUB_ENV
echo "Contents of .conda directory:"
ls -al .conda
echo "Contents of meta.yaml:"
cat .conda/meta.yaml
echo "Testing conda-render:"
conda render .conda
# Build the Conda binary
conda-build --token "$CONDA_TOKEN" --user rmg .conda