Update release_conda.yml #58
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: | |
| # Solo se ejecuta en 'release' para asegurar que siempre haya una etiqueta válida | |
| release: | |
| types: [published] | |
| # Mantengo estos activadores, pero la versión será '0.0.0-dev' o 'latest' | |
| push: | |
| branches: [conda_cd] | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # 1. Configurar Miniconda y Mamba | |
| - name: Setup Miniconda and Conda Tools | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| python-version: '3.10' | |
| channels: conda-forge,defaults | |
| auto-install-conda: true | |
| auto-update-conda: true | |
| mamba-version: "*" | |
| activate-environment: false | |
| # 2. INSTALACIÓN DE HERRAMIENTAS DE DESPLIEGUE | |
| - name: Install anaconda-client and conda-build | |
| shell: bash | |
| run: | | |
| mamba install anaconda-client conda-build -y | |
| # 3. Configurar Autenticación para Anaconda.org | |
| - name: Configure Anaconda Token | |
| shell: bash | |
| run: | | |
| conda run anaconda config --set upload_token ${{ secrets.ANACONDA_TOKEN }} | |
| # 4. Construir y Subir el Paquete (Dinámicamente) | |
| - name: Conda Build and Upload Package | |
| shell: bash | |
| run: | | |
| CONDA_RECIPE_DIR=".github/conda" | |
| ANACONDA_CHANNEL="ctlearn-project" | |
| VERSION="${{ github.event.release.tag_name }}" | |
| echo "Building package version: $VERSION" | |
| # --- FASE DE CONSTRUCCIÓN --- | |
| # 1. Pasamos la versión como variable de entorno PACKAGE_VERSION | |
| conda run PACKAGE_VERSION=$VERSION conda build $CONDA_RECIPE_DIR | |
| # 2. --- FASE DE SUBIDA --- | |
| # Obtenemos la ruta del paquete construido | |
| PACKAGE_PATH=$(conda run PACKAGE_VERSION=$VERSION conda build $CONDA_RECIPE_DIR --output) | |
| # 3. Subimos el archivo | |
| echo "Uploading $PACKAGE_PATH to $ANACONDA_CHANNEL channel..." | |
| conda run anaconda upload "$PACKAGE_PATH" --force --user $ANACONDA_CHANNEL |