Fix Conda build workflow #97
Workflow file for this run
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: 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 | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: false | |
conda-solver: libmamba | |
auto-activate-base: true | |
activate-environment: "" | |
- name: Install Build Tools | |
run: conda install python anaconda-client conda-build | |
- name: Configure Auto-Upload | |
if: github.ref == 'refs/heads/stable' | |
run: | | |
conda 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 | |
# Add the conda-forge channel | |
conda config --add channels conda-forge | |
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 | |