Skip to content

Commit

Permalink
CI: Download and install miniconda
Browse files Browse the repository at this point in the history
  • Loading branch information
sebp committed Feb 4, 2024
1 parent 3c6a710 commit 65f3053
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 48 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/build.yaml
Expand Up @@ -14,22 +14,12 @@ jobs:
uses: actions/checkout@v4
- name: Setup Miniconda
run: |
$CONDA/bin/conda config --set always_yes yes --set changeps1 no
$CONDA/bin/conda config --set auto_update_conda false
$CONDA/bin/conda config --set show_channel_urls true
$CONDA/bin/conda config --set add_pip_as_python_dependency false
$CONDA/bin/conda config --set conda_build.pkg_format 2
$CONDA/bin/conda config --add channels sebp
sudo $CONDA/bin/conda update -q -n base conda
sudo $CONDA/bin/conda install -q -n base anaconda-client conda-build
sudo chown -R $USER $CONDA
$CONDA/bin/conda info --all
$CONDA/bin/conda config --show
./setup-conda.sh ${{ runner.os }} ${{ runner.arch }}
- name: Configure conda and conda-build
run: sudo ./setup-osx.sh
if: runner.os == 'macOS'
- name: Build package
run: $CONDA/bin/conda-build -m build_config/${{ runner.os }}-${{ matrix.config }}.yaml ./recipe
run: $CONDA/bin/conda-build -m build_config/${{ runner.os }}-${{ runner.arch }}-${{ matrix.config }}.yaml ./recipe
- name: Upload package
env:
BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions build_config/Linux-py38.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions build_config/Windows-py38.yaml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 0 additions & 20 deletions build_config/macOS-py38.yaml

This file was deleted.

53 changes: 53 additions & 0 deletions setup-conda.sh
@@ -0,0 +1,53 @@
#!/bin/bash

RUNNER_OS="${1}"
RUNNER_ARCH="${2}"

run_check_sha() {
echo "${1}" | shasum -a 256 --check --strict -
}

if [[ "${CONDA:-}" = "" ]]; then
# download and install conda
MINICONDA_VERSION="Miniconda3-py311_23.11.0-2"

if [[ "${RUNNER_OS}" = "macOS" ]] && [[ "${RUNNER_ARCH}" = "ARM64" ]]; then
MINICONDA_VERSION="${MINICONDA_VERSION}-MacOSX-arm64"
MINICONDA_HASH="5694c382e6056d62ed874f22692224c4f53bca22e8135b6f069111e081be07aa"
elif [[ "${RUNNER_OS}" = "macOS" ]] && [[ "${RUNNER_ARCH}" = "X64" ]]; then
MINICONDA_VERSION="${MINICONDA_VERSION}-MacOSX-x86_64"
MINICONDA_HASH="2b7f9e46308c28c26dd83abad3e72121ef63916eaf17b63723b5a1f728dc3032"
elif [[ "${RUNNER_OS}" = "Linux" ]] && [[ "${RUNNER_ARCH}" = "X64" ]]; then
MINICONDA_VERSION="${MINICONDA_VERSION}-Linux-x86_64"
MINICONDA_HASH="c9ae82568e9665b1105117b4b1e499607d2a920f0aea6f94410e417a0eff1b9c"
else
echo "Unsupported OS or ARCH: ${RUNNER_OS} ${RUNNER_ARCH}"
exit 1
fi

export CONDA="${GITHUB_WORKSPACE}/miniconda3"

mkdir -p "${CONDA}" && \
curl "https://repo.anaconda.com/miniconda/${MINICONDA_VERSION}.sh" -o "${CONDA}/miniconda.sh" && \
run_check_sha "${MINICONDA_HASH} ${CONDA}/miniconda.sh" && \
bash "${CONDA}/miniconda.sh" -b -u -p "${CONDA}" && \
rm -rf "${CONDA}/miniconda.sh" || exit 1

echo "CONDA=${CONDA}" >> "${GITHUB_ENV}"
fi

"${CONDA}/bin/conda" config --set always_yes yes --set changeps1 no && \
"${CONDA}/bin/conda" config --set auto_update_conda false && \
"${CONDA}/bin/conda" config --set show_channel_urls true && \
"${CONDA}/bin/conda" config --set add_pip_as_python_dependency false && \
"${CONDA}/bin/conda" config --set conda_build.pkg_format 2 && \
"${CONDA}/bin/conda" config --add channels sebp || \
exit 1

sudo "${CONDA}/bin/conda" update -q -n base conda && \
sudo "${CONDA}/bin/conda" install -q -n base anaconda-client conda-build && \
sudo chown -R "${USER}" "${CONDA}" || \
exit 1

"${CONDA}/bin/conda" info --all
"${CONDA}/bin/conda" config --show

0 comments on commit 65f3053

Please sign in to comment.