Skip to content

Commit

Permalink
Merge pull request #3 from jaimergp/update-4.14
Browse files Browse the repository at this point in the history
Update installers to conda 4.14
  • Loading branch information
jaimergp authored Aug 26, 2022
2 parents e70fa20 + 0dd1f4d commit 2935cbb
Show file tree
Hide file tree
Showing 23 changed files with 819 additions and 152 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @conda-forge/miniforge
7 changes: 7 additions & 0 deletions .github/actions/autoupdate/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: miniconda-autoupdate
channels:
- conda-forge
- nodefaults
dependencies:
- packaging
- requests
27 changes: 27 additions & 0 deletions .github/actions/autoupdate/update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python

import re
import requests
from packaging import version

def get_most_recent_version(name):
request = requests.get(
"https://api.anaconda.org/package/conda-forge/" + name
)
request.raise_for_status()

pkg = max(
request.json()["files"], key=lambda x: version.parse(x["version"])
)
return pkg["version"]

mamba_version = get_most_recent_version("mamba")

with open("Miniforge3/construct.yaml", "r") as f:
content = f.read()

# Replace mamba version
content = re.sub(r"mamba [\d.]+$", f"mamba {mamba_version}", content, flags=re.M)

with open("Miniforge3/construct.yaml", "w") as f:
f.write(content)
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
17 changes: 17 additions & 0 deletions .github/shellcheck-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "shellcheck",
"pattern": [
{
"regexp": "^(.+):(\\d+):(\\d+):\\s(note|warning|error):\\s(.*)\\s\\[(SC\\d+)\\]$",
"file": 1,
"line": 2,
"column": 3,
"message": 5,
"code": 6
}
]
}
]
}
32 changes: 32 additions & 0 deletions .github/workflows/autoupdate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Auto-update mamba
on:
schedule:
- cron: "0 */6 * * *"
jobs:
createPullRequest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.MINIFORGE_AUTOUPDATE_SSH_PRIVATE_KEY }}
- uses: conda-incubator/setup-miniconda@35d1405e78aa3f784fe3ce9a2eb378d5eeb62169
with:
miniforge-variant: Miniforge3
environment-file: .github/actions/autoupdate/environment.yml
- run: python .github/actions/autoupdate/update.py
- name: Create Pull Request
id: cpr
# This is the v3 tag but for security purposes we pin to the exact commit.
uses: peter-evans/create-pull-request@18f90432bedd2afd6a825469ffd38aa24712a91d
with:
commit-message: "Update mamba version"
title: "Update mamba version"
body: |
This PR was created by the autoupdate action as it detected that
the mamba version has changed and thus should be updated
in the configuration.
Due to limitations of Github Actions, you will need to close/reopen
the PR to get the actions running.
branch: autoupdate-action
delete-branch: true
92 changes: 61 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,147 +11,165 @@ jobs:
include:
# - os: windows-latest
# ARCH: x86_64
# TARGET_PLATFORM: win-64
# MINIFORGE_NAME: "Miniforge3"
# OS_NAME: "Windows"

# - os: windows-latest
# ARCH: x86_64
# TARGET_PLATFORM: win-64
# MINIFORGE_NAME: "Mambaforge"
# OS_NAME: "Windows"

# - os: windows-latest
# ARCH: x86_64
# TARGET_PLATFORM: win-64
# MINIFORGE_NAME: "Miniforge-pypy3"
# OS_NAME: "Windows"

# - os: windows-latest
# ARCH: x86_64
# TARGET_PLATFORM: win-64
# MINIFORGE_NAME: "Mambaforge-pypy3"
# OS_NAME: "Windows"

# - os: macos-latest
# ARCH: arm64
# TARGET_PLATFORM: osx-arm64
# MINIFORGE_NAME: "Miniforge3"
# OS_NAME: "MacOSX"

# - os: macos-latest
# ARCH: arm64
# TARGET_PLATFORM: osx-arm64
# MINIFORGE_NAME: "Mambaforge"
# OS_NAME: "MacOSX"

# - os: macos-latest
# ARCH: x86_64
# TARGET_PLATFORM: osx-64
# MINIFORGE_NAME: "Miniforge-pypy3"
# OS_NAME: "MacOSX"

# - os: macos-latest
# ARCH: x86_64
# TARGET_PLATFORM: osx-64
# MINIFORGE_NAME: "Mambaforge-pypy3"
# OS_NAME: "MacOSX"

# - os: macos-latest
# ARCH: x86_64
# TARGET_PLATFORM: osx-64
# MINIFORGE_NAME: "Miniforge3"
# OS_NAME: "MacOSX"

# - os: macos-latest
# ARCH: x86_64
# TARGET_PLATFORM: osx-64
# MINIFORGE_NAME: "Mambaforge"
# OS_NAME: "MacOSX"

# - os: ubuntu-latest
# ARCH: aarch64
# TARGET_PLATFORM: linux-aarch64
# DOCKER_ARCH: arm64v8
# DOCKERIMAGE: condaforge/linux-anvil-aarch64
# MINIFORGE_NAME: "Miniforge3"
# OS_NAME: "Linux"

# - os: ubuntu-latest
# ARCH: aarch64
# TARGET_PLATFORM: linux-aarch64
# DOCKER_ARCH: arm64v8
# DOCKERIMAGE: condaforge/linux-anvil-aarch64
# MINIFORGE_NAME: "Mambaforge"
# OS_NAME: "Linux"

# - os: ubuntu-latest
# ARCH: x86_64
# DOCKER_ARCH: amd64
# DOCKERIMAGE: condaforge/linux-anvil-comp7
# MINIFORGE_NAME: "Miniforge3"
# OS_NAME: "Linux"
- os: ubuntu-latest
ARCH: x86_64
TARGET_PLATFORM: linux-64
DOCKER_ARCH: amd64
DOCKERIMAGE: condaforge/linux-anvil-comp7
MINIFORGE_NAME: "Mambaforge-colab"
OS_NAME: "Linux"

# - os: ubuntu-latest
# ARCH: x86_64
# DOCKER_ARCH: amd64
# DOCKERIMAGE: condaforge/linux-anvil-comp7
# MINIFORGE_NAME: "Mambaforge"
# OS_NAME: "Linux"
- os: ubuntu-latest
ARCH: x86_64
TARGET_PLATFORM: linux-64
DOCKER_ARCH: amd64
DOCKERIMAGE: condaforge/linux-anvil-comp7
MINIFORGE_NAME: "Miniforge-colab"
OS_NAME: "Linux"

# - os: ubuntu-latest
# ARCH: ppc64le
# TARGET_PLATFORM: linux-ppc64le
# DOCKER_ARCH: ppc64le
# DOCKERIMAGE: condaforge/linux-anvil-ppc64le
# MINIFORGE_NAME: "Miniforge3"
# OS_NAME: "Linux"

# - os: ubuntu-latest
# ARCH: ppc64le
# TARGET_PLATFORM: linux-ppc64le
# DOCKER_ARCH: ppc64le
# DOCKERIMAGE: condaforge/linux-anvil-ppc64le
# MINIFORGE_NAME: "Mambaforge"
# OS_NAME: "Linux"

# - os: ubuntu-latest
# ARCH: aarch64
# TARGET_PLATFORM: linux-aarch64
# DOCKER_ARCH: arm64v8
# DOCKERIMAGE: condaforge/linux-anvil-aarch64
# MINIFORGE_NAME: "Miniforge-pypy3"
# OS_NAME: "Linux"

# - os: ubuntu-latest
# ARCH: aarch64
# TARGET_PLATFORM: linux-aarch64
# DOCKER_ARCH: arm64v8
# DOCKERIMAGE: condaforge/linux-anvil-aarch64
# MINIFORGE_NAME: "Mambaforge-pypy3"
# OS_NAME: "Linux"

# - os: ubuntu-latest
# ARCH: x86_64
# TARGET_PLATFORM: linux-64
# DOCKER_ARCH: amd64
# DOCKERIMAGE: condaforge/linux-anvil-comp7
# MINIFORGE_NAME: "Miniforge-pypy3"
# OS_NAME: "Linux"

# - os: ubuntu-latest
# ARCH: x86_64
# TARGET_PLATFORM: linux-64
# DOCKER_ARCH: amd64
# DOCKERIMAGE: condaforge/linux-anvil-comp7
# MINIFORGE_NAME: "Mambaforge-pypy3"
# OS_NAME: "Linux"

# - os: ubuntu-latest
# ARCH: ppc64le
# TARGET_PLATFORM: linux-ppc64le
# DOCKER_ARCH: ppc64le
# DOCKERIMAGE: condaforge/linux-anvil-ppc64le
# MINIFORGE_NAME: "Miniforge-pypy3"
# OS_NAME: "Linux"

# - os: ubuntu-latest
# ARCH: ppc64le
# TARGET_PLATFORM: linux-ppc64le
# DOCKER_ARCH: ppc64le
# DOCKERIMAGE: condaforge/linux-anvil-ppc64le
# MINIFORGE_NAME: "Mambaforge-pypy3"
# OS_NAME: "Linux"

- os: ubuntu-latest
ARCH: x86_64
DOCKER_ARCH: amd64
DOCKERIMAGE: condaforge/linux-anvil-comp7
MINIFORGE_NAME: "Mambaforge-colab"
OS_NAME: "Linux"

- os: ubuntu-latest
ARCH: x86_64
DOCKER_ARCH: amd64
DOCKERIMAGE: condaforge/linux-anvil-comp7
MINIFORGE_NAME: "Miniforge-colab"
OS_NAME: "Linux"

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@35d1405e78aa3f784fe3ce9a2eb378d5eeb62169
with:
miniconda-version: "latest"
if: contains(matrix.OS_NAME, 'Windows')
Expand All @@ -163,28 +181,40 @@ jobs:
OS_NAME: ${{ matrix.OS_NAME }}
DOCKERIMAGE: ${{ matrix.DOCKERIMAGE }}
DOCKER_ARCH: ${{ matrix.DOCKER_ARCH }}
TARGET_PLATFORM: ${{ matrix.TARGET_PLATFORM }}
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
export MINIFORGE_VERSION=${GITHUB_REF##*/};
fi
if [[ "$OS_NAME" == "Linux" ]]; then
export EXT=sh
bash build_miniforge.sh;
EXT=sh
fi
if [[ "$OS_NAME" == "MacOSX" ]]; then
export EXT=sh
bash build_miniforge_osx.sh;
EXT=sh
fi
if [[ "$OS_NAME" == "Windows" ]]; then
export EXT=exe
echo "WINDIR:$WINDIR"
source /c/Miniconda3/Scripts/activate;
source build_miniforge_win.sh;
EXT=exe
fi
# Copy for latest release
cp build/$MINIFORGE_NAME-*-$OS_NAME-$ARCH.$EXT build/$MINIFORGE_NAME-$OS_NAME-$ARCH.$EXT
if [[ "$OS_NAME" == "MacOSX" ]]; then
cp build/$MINIFORGE_NAME-*-$OS_NAME-$ARCH.$EXT build/$MINIFORGE_NAME-Darwin-$ARCH.$EXT
fi
ls -alh build
shell: bash

- name: Upload miniforge to Github artifact
if: always()
uses: actions/upload-artifact@v3
with:
path: build/${{ matrix.MINIFORGE_NAME }}-${{ matrix.OS_NAME }}-${{ matrix.ARCH }}*
name: ${{ matrix.MINIFORGE_NAME }}-${{ matrix.OS_NAME }}-${{ matrix.ARCH }}

- name: Upload miniforge to release
uses: svenstaro/upload-release-action@v2
with:
Expand Down
Loading

0 comments on commit 2935cbb

Please sign in to comment.