Update release_conda.yml #37
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Conda | |
| on: | |
| push: | |
| branches: [conda_cd] | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| condapublish: | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| id-token: write | |
| contents: write | |
| deployments: write | |
| statuses: write | |
| actions: write | |
| checks: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| # ⚡ Instalar Miniforge (mamba integrado y más rápido) | |
| - name: Set up Miniforge | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: latest | |
| use-mamba: true | |
| auto-activate-base: true | |
| activate-environment: "" | |
| auto-update-conda: false | |
| # ⚡ Cache del entorno con hash de environment.yml | |
| - name: Cache conda packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/conda_pkgs_dir | |
| key: conda-pkgs-${{ runner.os }}-${{ hashFiles('environment.yml') }} | |
| # ⚡ Crear entorno con Mamba (mucho más rápido) | |
| - name: Create conda environment | |
| run: | | |
| mamba env create -f environment.yml --quiet | |
| env: | |
| CONDA_PKGS_DIRS: ~/conda_pkgs_dir | |
| # Instalar pip deps si las tienes fuera del YAML | |
| - name: Install pip dependencies | |
| run: | | |
| mamba run -n dl1dh pip install -U pydot --quiet | |
| # ⚡ Instalar herramientas de build (usa mamba) | |
| - name: Install conda-build and anaconda-client | |
| run: | | |
| mamba install -y -c conda-forge conda-build anaconda-client | |
| # Obtener versión de tag | |
| - name: Determine version from Git tag | |
| id: git_version | |
| run: | | |
| echo "GIT_DESCRIBE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | |
| # Sustituir versión en meta.yaml | |
| - name: Set dynamic version in meta.yaml | |
| run: | | |
| VERSION_NUMBER="${GIT_DESCRIBE_TAG#v}" | |
| sed -i "s|^{% set version.*%}|{% set version = \"$VERSION_NUMBER\" %}|" .github/conda/meta.yaml | |
| # ⚡ Build rápido con mamba-build (si disponible) | |
| - name: Build conda package | |
| run: | | |
| PACKAGE_FILE=$(conda build .github/conda --output) | |
| echo "Building: $PACKAGE_FILE" | |
| conda build .github/conda --quiet | |
| - name: Upload package to Anaconda.org | |
| env: | |
| ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
| run: | | |
| PACKAGE_FILE=$(conda build .github/conda --output) | |
| echo "Uploading $PACKAGE_FILE" | |
| anaconda upload "$PACKAGE_FILE" --user ctlearn-project --label main --force |