Skip to content

Commit

Permalink
Fixed Conda build by:
Browse files Browse the repository at this point in the history
>> Setting the condarc file to only use the
conda-forge channel

>> Use Miniforge3 instead of Miniconda3 with the
libmamba solver
  • Loading branch information
ssun30 committed Nov 22, 2024
1 parent 881e246 commit 6dc8c8d
Showing 1 changed file with 64 additions and 24 deletions.
88 changes: 64 additions & 24 deletions .github/workflows/conda_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,88 @@ jobs:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
- uses: actions/checkout@v4
- name: Create custom conda config file
run: |
RUNNER_CWD=$(pwd)
echo "channels:" > $RUNNER_CWD/condarc.yml
echo " - rmg" >> $RUNNER_CWD/condarc.yml
echo "show_channel_urls: true" >> $RUNNER_CWD/condarc.yml
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment.yml
miniforge-variant: Miniforge3
miniforge-version: latest
python-version: 3.7
activate-environment: rmg_env
use-mamba: true
- name: Conda info
run: |
conda info
conda list
mamba info
mamba list
- name: Install Build Tools
run: |
mamba install -y anaconda-client conda-build conda-verify
- name: Configure Auto-Upload
run: |
mamba config --set anaconda_upload yes
- name: Build Binary
env:
CONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
conda install -y conda-build
conda install -y anaconda-client
conda config --add channels rmg
conda config --set anaconda_upload yes
conda build --token $CONDA_TOKEN --user rmg .conda
# 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 "CONDA_TOKEN=$CONDA_TOKEN" >> $GITHUB_ENV
# Build the Conda binary
conda-build --token "$CONDA_TOKEN" --user rmg .conda

build-osx:
runs-on: macos-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
- uses: actions/checkout@v4
- name: Create custom conda config file
run: |
RUNNER_CWD=$(pwd)
echo "channels:" > $RUNNER_CWD/condarc.yml
echo " - rmg" >> $RUNNER_CWD/condarc.yml
echo "show_channel_urls: true" >> $RUNNER_CWD/condarc.yml
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment.yml
miniforge-variant: Miniforge3
miniforge-version: latest
python-version: 3.7
activate-environment: rmg_env
use-mamba: true
- name: Conda info
run: |
conda info
conda list
mamba info
mamba list
- name: Install Build Tools
run: |
mamba install -y anaconda-client conda-build conda-verify
- name: Configure Auto-Upload
run: |
mamba config --set anaconda_upload yes
- name: Build Binary
env:
CONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
conda install -y conda-build
conda install -y anaconda-client
conda config --add channels rmg
conda config --set anaconda_upload yes
xcrun --show-sdk-path
conda build --token $CONDA_TOKEN --user rmg .conda
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 "CONDA_TOKEN=$CONDA_TOKEN" >> $GITHUB_ENV
xcrun --show-sdk-path
conda build --token $CONDA_TOKEN --user rmg .conda

0 comments on commit 6dc8c8d

Please sign in to comment.