Skip to content

Standardize anaconda uploads: use consistent username and GitHub secret #8

Standardize anaconda uploads: use consistent username and GitHub secret

Standardize anaconda uploads: use consistent username and GitHub secret #8

name: QuantX Python & Conda Build
on:
push:
branches: [main, anaconda-integration]
pull_request:
branches: [main, anaconda-integration]
release:
types: [published]
jobs:
build-test-conda:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: "3.10"
activate-environment: quantx
environment-file: environment.yml
# --- New: Install and use libmamba solver ---
- name: Install conda-libmamba-solver
shell: bash -l {0}
run: |
conda install -n base conda-libmamba-solver -c conda-forge -y
conda config --set solver libmamba
# --- New: Install vectorbt via pip only (not conda) ---
# - name: Install pip dependencies (including vectorbt)
# shell: bash -l {0}
# run: |
# pip install -e .
# pip install vectorbt
# (Optional fallback for problematic packages)
# - name: Install gym and orange3 via pip if not installed by conda
# shell: bash -l {0}
# run: |
# pip install gym orange3
# - name: Run Python tests
# shell: bash -l {0}
# run: |
# pytest tests/python
- name: Build Conda package
shell: bash -l {0}
run: |
conda install conda-build anaconda-client -y
conda build conda-recipe-matrix
- name: Upload Conda package to Anaconda (releases only)
if: github.event_name == 'release'
env:
ANACONDA_API_TOKEN: ${{ secrets.CICD_TOKEN_GH_ANACONDA }}
shell: bash -l {0}
run: |
PKG_PATH=$(conda build conda-recipe-matrix --output)
anaconda upload -u quantdiy --label main --force $PKG_PATH
- name: Upload Conda package as Release Candidate
if: github.ref == 'refs/heads/anaconda-integration' && github.event_name == 'push'
env:
ANACONDA_API_TOKEN: ${{ secrets.CICD_TOKEN_GH_ANACONDA }}
shell: bash -l {0}
run: |
PKG_PATH=$(conda build conda-recipe-matrix --output)
anaconda upload -u quantdiy --label rc --force $PKG_PATH
echo "✅ QuantX Release Candidate published to Anaconda!"
echo "🚀 Install with: conda install -c quantdiy/label/rc quantx"