Update meta.yaml #74
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: | |
| release: | |
| types: [published] | |
| push: | |
| branches: [conda_cd] | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository and fetch tags | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Miniconda and Conda Tools | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| python-version: '3.10' | |
| channels: conda-forge | |
| auto-update-conda: true | |
| mamba-version: "*" | |
| activate-environment: false | |
| - name: Install anaconda-client and conda-build | |
| shell: bash | |
| run: | | |
| mamba install anaconda-client conda-build -y | |
| - name: Conda Build and Upload Package | |
| shell: bash | |
| env: | |
| ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
| run: | | |
| CONDA_RECIPE_DIR=".github/conda" | |
| ANACONDA_CHANNEL="ctlearn-project" | |
| FULL_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0+dev") | |
| VERSION="${FULL_TAG#v}" | |
| VERSION="${VERSION#V}" | |
| echo "Building package version: $VERSION" | |
| export PACKAGE_VERSION=$VERSION | |
| conda run conda build $CONDA_RECIPE_DIR | |
| PACKAGE_PATH=$(conda run conda build $CONDA_RECIPE_DIR --output) | |
| if [[ "$VERSION" != "0.0.0+dev" ]]; then | |
| echo "Uploading $PACKAGE_PATH to $ANACONDA_CHANNEL channel..." | |
| conda run anaconda upload \ | |
| "$PACKAGE_PATH" \ | |
| --force \ | |
| --user $ANACONDA_CHANNEL | |
| else | |
| echo "Skipping upload: Version is $VERSION (development)." | |
| fi |