Skip to content

Commit 04c6e1f

Browse files
authored
Update release_conda.yml
1 parent e715761 commit 04c6e1f

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

.github/workflows/release_conda.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@ jobs:
1919
checks: read
2020

2121
env:
22-
CONDA_NO_PLUGINS: true
2322
CONDA_PKGS_DIRS: ~/conda_pkgs_dir
2423

2524
steps:
25+
# 1️⃣ Checkout repo
2626
- name: Checkout repository
2727
uses: actions/checkout@v4
2828
with:
2929
fetch-depth: 0
3030

31+
# 2️⃣ Set up Miniforge + Mamba
3132
- name: Set up Miniforge
3233
uses: conda-incubator/setup-miniconda@v3
3334
with:
@@ -37,65 +38,67 @@ jobs:
3738
activate-environment: ""
3839
auto-activate-base: true
3940

41+
# 3️⃣ Cache de paquetes
4042
- name: Cache conda packages
4143
uses: actions/cache@v4
4244
with:
4345
path: ~/conda_pkgs_dir
4446
key: conda-pkgs-${{ runner.os }}-${{ hashFiles('environment.yml') }}
4547

48+
# 4️⃣ Crear entorno del proyecto
4649
- name: Create conda environment
4750
run: |
4851
mamba env create -f environment.yml --quiet
4952
53+
# 5️⃣ Instalar pip deps extra
5054
- name: Install pip dependencies
5155
run: |
5256
mamba run -n dl1dh pip install -U pydot --quiet
5357
58+
# 6️⃣ Instalar conda-build y anaconda-client
5459
- name: Install conda-build and anaconda-client
5560
run: |
5661
mamba install -y -c conda-forge conda-build anaconda-client
62+
conda build --version
63+
anaconda --version
5764
58-
# Detectar ruta base de conda (segura en cualquier runner)
65+
# 7️⃣ Detectar ruta base de Conda
5966
- name: Detect Conda base path
6067
id: conda_path
6168
run: |
6269
echo "CONDA_BASE=$(conda info --base)" >> $GITHUB_ENV
63-
echo "Conda base is: $(conda info --base)"
64-
65-
- name: Verify conda-build installation
66-
run: |
67-
source $CONDA_BASE/etc/profile.d/conda.sh
68-
conda activate base
69-
which conda
70-
conda --version
71-
conda build --version || echo "conda-build not found"
70+
echo "Conda base is: $CONDA_BASE"
7271
72+
# 8️⃣ Obtener versión del tag
7373
- name: Determine version from Git tag
7474
id: git_version
7575
run: |
7676
echo "GIT_DESCRIBE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
7777
78+
# 9️⃣ Sustituir versión en meta.yaml
7879
- name: Set dynamic version in meta.yaml
7980
run: |
8081
VERSION_NUMBER="${GIT_DESCRIBE_TAG#v}"
81-
echo "Setting version to $VERSION_NUMBER"
8282
sed -i "s|^{% set version.*%}|{% set version = \"$VERSION_NUMBER\" %}|" .github/conda/meta.yaml
8383
84+
# 🔟 Build del paquete Conda
8485
- name: Build conda package
86+
env:
87+
CONDA_NO_PLUGINS: false # necesario para conda-build
8588
run: |
8689
source $CONDA_BASE/etc/profile.d/conda.sh
8790
conda activate base
88-
echo "Conda build version: $(conda build --version)"
8991
PACKAGE_FILE=$(conda build .github/conda --output)
9092
echo "Building package: $PACKAGE_FILE"
9193
conda build .github/conda --quiet
9294
95+
# 1️⃣1️⃣ Subida a Anaconda.org
9396
- name: Upload package to Anaconda.org
9497
env:
9598
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
99+
CONDA_NO_PLUGINS: false
96100
run: |
97101
source $CONDA_BASE/etc/profile.d/conda.sh
98102
conda activate base
99103
PACKAGE_FILE=$(conda build .github/conda --output)
100-
echo "Uploading package: $PACKAGE_FILE"
101104
anaconda upload "$PACKAGE_FILE" --user ctlearn-project --label main --force

0 commit comments

Comments
 (0)