Skip to content

Commit a483e72

Browse files
committed
Fixed Conda build by:
>> Setting the condarc file to only use the conda-forge channel >> Use Miniforge3 instead of Miniconda3 with the libmamba solver
1 parent 881e246 commit a483e72

File tree

1 file changed

+64
-24
lines changed

1 file changed

+64
-24
lines changed

.github/workflows/conda_build.yml

Lines changed: 64 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,48 +11,88 @@ jobs:
1111
run:
1212
shell: bash -l {0}
1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: conda-incubator/setup-miniconda@v2
14+
- uses: actions/checkout@v4
15+
- name: Create custom conda config file
16+
run: |
17+
RUNNER_CWD=$(pwd)
18+
echo "channels:" > $RUNNER_CWD/condarc.yml
19+
echo " - rmg" >> $RUNNER_CWD/condarc.yml
20+
echo "show_channel_urls: true" >> $RUNNER_CWD/condarc.yml
21+
- name: Setup Conda
22+
uses: conda-incubator/setup-miniconda@v3
1623
with:
1724
environment-file: environment.yml
25+
miniforge-variant: Miniforge3
26+
miniforge-version: latest
1827
python-version: 3.7
1928
activate-environment: rmg_env
29+
use-mamba: true
2030
- name: Conda info
2131
run: |
22-
conda info
23-
conda list
32+
mamba info
33+
mamba list
34+
- name: Install Build Tools
35+
run: |
36+
mamba install -y anaconda-client conda-build conda-verify
37+
- name: Configure Auto-Upload
38+
run: |
39+
conda config --set anaconda_upload yes
2440
- name: Build Binary
25-
env:
26-
CONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
2741
run: |
28-
conda install -y conda-build
29-
conda install -y anaconda-client
30-
conda config --add channels rmg
31-
conda config --set anaconda_upload yes
32-
conda build --token $CONDA_TOKEN --user rmg .conda
42+
# Set the CONDA_TOKEN environment variable
43+
if [ -z "${{ secrets.ANACONDA_TOKEN }}" ]; then
44+
export CONDA_TOKEN="default_value"
45+
else
46+
export CONDA_TOKEN="${{ secrets.ANACONDA_TOKEN }}"
47+
fi
48+
49+
echo "CONDA_TOKEN=$CONDA_TOKEN" >> $GITHUB_ENV
50+
51+
# Build the Conda binary
52+
conda-build --token "$CONDA_TOKEN" --user rmg .conda
53+
3354
build-osx:
3455
runs-on: macos-latest
3556
defaults:
3657
run:
3758
shell: bash -l {0}
3859
steps:
39-
- uses: actions/checkout@v2
40-
- uses: conda-incubator/setup-miniconda@v2
60+
- uses: actions/checkout@v4
61+
- name: Create custom conda config file
62+
run: |
63+
RUNNER_CWD=$(pwd)
64+
echo "channels:" > $RUNNER_CWD/condarc.yml
65+
echo " - rmg" >> $RUNNER_CWD/condarc.yml
66+
echo "show_channel_urls: true" >> $RUNNER_CWD/condarc.yml
67+
- name: Setup Conda
68+
uses: conda-incubator/setup-miniconda@v3
4169
with:
4270
environment-file: environment.yml
71+
miniforge-variant: Miniforge3
72+
miniforge-version: latest
4373
python-version: 3.7
4474
activate-environment: rmg_env
75+
use-mamba: true
4576
- name: Conda info
4677
run: |
47-
conda info
48-
conda list
78+
mamba info
79+
mamba list
80+
- name: Install Build Tools
81+
run: |
82+
mamba install -y anaconda-client conda-build conda-verify
83+
- name: Configure Auto-Upload
84+
run: |
85+
conda config --set anaconda_upload yes
4986
- name: Build Binary
50-
env:
51-
CONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
52-
run: |
53-
conda install -y conda-build
54-
conda install -y anaconda-client
55-
conda config --add channels rmg
56-
conda config --set anaconda_upload yes
57-
xcrun --show-sdk-path
58-
conda build --token $CONDA_TOKEN --user rmg .conda
87+
run: |
88+
# Set the CONDA_TOKEN environment variable
89+
if [ -z "${{ secrets.ANACONDA_TOKEN }}" ]; then
90+
export CONDA_TOKEN="default_value"
91+
else
92+
export CONDA_TOKEN="${{ secrets.ANACONDA_TOKEN }}"
93+
fi
94+
95+
echo "CONDA_TOKEN=$CONDA_TOKEN" >> $GITHUB_ENV
96+
97+
xcrun --show-sdk-path
98+
conda build --token $CONDA_TOKEN --user rmg .conda

0 commit comments

Comments
 (0)