Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions .github/workflows/BuildCommanderConda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ on:

env:
QEMU_STATIC_VERSION: "v3.1.0-3"
MINIFORGE_URL: "https://github.com/conda-forge/miniforge/releases/download/4.8.5-1"
MINIFORGE_FILE: "Miniforge3-4.8.5-1-MacOSX-x86_64.sh"
MINIFORGE_SHA256: "5054599ee6ea639209b831d859935da50229040d7993b1736358734d1e9c5edc"
MINIFORGE_VERSION: "4.12.0-2" # needs to be updated in matrix section too--fix this.
MINIFORGE_URL: "https://github.com/conda-forge/miniforge/releases/download"

jobs:
build:
Expand All @@ -30,9 +29,19 @@ jobs:
matrix:
os: [ubuntu-18.04]
arch: [x86_64, aarch64, ppc64le]
TARGET_PLATFORM: [linux-64]
include:
- os: macos-latest
arch: x86_64
MINIFORGE_FILE: "Mambaforge-4.12.0-2-MacOSX-x86_64.sh"
MINIFORGE_SHA256: "562c2bcbabff10387f130acea72b960454fa3d90b593126e4e4febcf6da763d3"
TARGET_PLATFORM: osx-64
- os: macos-latest
arch: arm64
MINIFORGE_FILE: "Mambaforge-4.12.0-2-MacOSX-arm64.sh"
MINIFORGE_SHA256: "2e2be9d976da31b62ab314881d3c6ed3f65c76e3ea69cc4b59fb344780109026"
TARGET_PLATFORM: osx-arm64

outputs:
checksum1: ${{ steps.cksums.outputs.out-0 }}
checksum2: ${{ steps.cksums.outputs.out-1 }}
Expand All @@ -43,6 +52,7 @@ jobs:
env:
COMMANDERCONDA_NAME: CommanderConda3
ARCH: ${{ matrix.arch }}
TARGET_PLATFORM: ${{ matrix.TARGET_PLATFORM }}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
Expand All @@ -68,21 +78,34 @@ jobs:
if: runner.os == 'macOS'
with:
path: build/miniforge
key: miniforge-${{ env.MINIFORGE_SHA256 }}-${{ hashFiles('.github/workflows/BuildCommanderConda.yml') }}
key: miniforge-${{ matrix.MINIFORGE_SHA256 }}-${{ hashFiles('.github/workflows/BuildCommanderConda.yml') }}
- name: get miniforge
if: steps.cache-miniforge.outputs.cache-hit != 'true' && runner.os == 'macOS'
run: |
mkdir -p ./build/miniforge || true
cd ./build/miniforge
curl -L -O "${MINIFORGE_URL}/${MINIFORGE_FILE}"
echo "curl -L -s \"${MINIFORGE_URL}/${MINIFORGE_VERSION}/${{ matrix.MINIFORGE_FILE }}\" > \"${{ matrix.MINIFORGE_FILE }}\""
curl -L -s "${MINIFORGE_URL}/${MINIFORGE_VERSION}/${{ matrix.MINIFORGE_FILE }}" > "${{ matrix.MINIFORGE_FILE }}"
- name: verify minforge checksum
if: runner.os == 'macOS'
working-directory: build/miniforge
env:
MINIFORGE_FILE: ${{ matrix.MINIFORGE_FILE }}
run: |
echo "${MINIFORGE_SHA256} *${MINIFORGE_FILE}" | tee ${MINIFORGE_FILE}.sha256
echo "${{ matrix.MINIFORGE_SHA256 }} *${MINIFORGE_FILE}" | tee ${MINIFORGE_FILE}.sha256
shasum -c ./${MINIFORGE_FILE}.sha256
- name: Build and test CommanderConda
run: ./build_CommanderConda_${{ runner.os }}.sh
env:
MINIFORGE_FILE: build/miniforge/${{ matrix.MINIFORGE_FILE }}
run: |
if [[ "${{ runner.os }}" == Linux ]] ; then
if [[ "$ARCH" != x86_64 ]] ; then
TARGET_PLATFORM="linux-$ARCH"
fi
fi
export TARGET_PLATFORM
echo "Target arch: ${TARGET_PLATFORM}"
./build_CommanderConda_${{ runner.os }}.sh
- name: Checksum Outputs
id: cksums
working-directory: build
Expand Down
2 changes: 1 addition & 1 deletion CommanderConda/construct.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = os.environ.get("COMMANDERCONDA_VERSION", "4.12.0-0") %}
{% set version = os.environ.get("COMMANDERCONDA_VERSION", "4.12.0-2") %}


name: CommanderConda3
Expand Down
3 changes: 2 additions & 1 deletion build_CommanderConda_Linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ esac

export DOCKER_ARCH
export DOCKERIMAGE
export TARGET_PLATFORM

echo "============= Create build directory ============="
mkdir -p build/ || true
Expand All @@ -32,7 +33,7 @@ docker run --rm --privileged multiarch/qemu-user-static:register --reset --crede

echo "============= Build the installer ============="
# See github actions issue #241 comment here: https://github.com/actions/runner/issues/241#issuecomment-577360161
script -e -c "docker run --rm -ti -v $(pwd):/construct -e GITHUB_REF -e ARCH -e COMMANDERCONDA_VERSION $DOCKERIMAGE /construct/scripts/build.sh"
script -e -c "docker run --rm -ti -v $(pwd):/construct -e GITHUB_REF -e TARGET_PLATFORM -e ARCH -e COMMANDERCONDA_VERSION $DOCKERIMAGE /construct/scripts/build.sh"

echo "============= Test the installer ============="
for TEST_IMAGE_NAME in "ubuntu:20.04" "ubuntu:16.04" "ubuntu:18.04" "centos:7" "debian:buster" "opensuse:42.3"
Expand Down
33 changes: 29 additions & 4 deletions build_CommanderConda_macOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,51 @@ set -o pipefail
set -o nounset

echo "Installing Miniforge3."
chmod +x "build/miniforge/${MINIFORGE_FILE}"
./build/miniforge/"${MINIFORGE_FILE}" -b
chmod +x "${MINIFORGE_FILE}"

echo "Configuring conda."
echo "Shell: ${SHELL}"
echo "Shell arch info:"

lipo -info "${SHELL}"
file "${SHELL}"

echo "Working directory:"
pwd

ls -la
ls -la build
ls -la build/miniforge

echo "\$MINIFORGE_FILE = ${MINIFORGE_FILE}"

set +o errexit
set +o nounset
# set +o verbose

lipo -info "$(which bash)"
file "$(which bash)"

arch -"$(uname -m)" bash "${MINIFORGE_FILE}" -b -p ~/conda

echo "Configuring conda."
#shellcheck disable=SC1090
source ~/miniforge3/bin/activate root
source ~/conda/bin/activate root
# set -o verbose
set -o nounset
set -o errexit

CONSTRUCT_ROOT="$(pwd)"
export CONSTRUCT_ROOT
export TARGET_PLATFORM

echo "============= Create build directory ============="
mkdir -p build/ || true
chmod 777 build/

echo "============= Build the installer ============="
ls -al ~/conda/bin
type -a constructor

./scripts/build.sh

echo "============= Test the installer ============="
Expand Down
17 changes: 11 additions & 6 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,25 @@ fi
conda list

echo "***** Make temp directory *****"
if [[ "$(uname)" == MINGW* ]]; then
TEMP_DIR=$(mktemp -d --tmpdir=C:/Users/RUNNER~1/AppData/Local/Temp/);
else
TEMP_DIR=$(mktemp -d);
fi
TEMP_DIR=$(mktemp -d);

echo "***** Copy file for installer construction *****"
cp -R CommanderConda "${TEMP_DIR}/"
cp LICENSE "${TEMP_DIR}/"

ls -al "${TEMP_DIR}"

MICROMAMBA_VERSION=0.23.0
mkdir "${TEMP_DIR}/micromamba"
pushd "${TEMP_DIR}/micromamba"
curl -L -O "https://anaconda.org/conda-forge/micromamba/${MICROMAMBA_VERSION}/download/${TARGET_PLATFORM}/micromamba-${MICROMAMBA_VERSION}-0.tar.bz2"
bsdtar -xf "micromamba-${MICROMAMBA_VERSION}-0.tar.bz2"
MICROMAMBA_FILE="${PWD}/bin/micromamba"
popd
EXTRA_CONSTRUCTOR_ARGS+=(--conda-exe "${MICROMAMBA_FILE}" --platform "${TARGET_PLATFORM}")

echo "***** Construct the installer *****"
constructor "$TEMP_DIR/CommanderConda/" --output-dir "$TEMP_DIR"
constructor "$TEMP_DIR/CommanderConda/" --output-dir "$TEMP_DIR" "${EXTRA_CONSTRUCTOR_ARGS[@]}"

echo "***** Generate installer hash *****"
cd "$TEMP_DIR"
Expand Down