defaults covered #3
Workflow file for this run
This file contains 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: Build and Upload Conda Package | |
on: | |
release: | |
types: ['published', 'prereleased'] | |
jobs: | |
build-conda-package: | |
runs-on: ubuntu-latest | |
env: | |
TZ: 'UTC' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniforge-version: 'latest' | |
auto-update-conda: true | |
activate-environment: build-env | |
python-version: '3.10' | |
- name: Install conda-build and anaconda-client | |
run: conda install -n build-env -y mamba conda-build anaconda-client | |
- name: Build Conda Package | |
id: build | |
run: | | |
# Define a separate build root outside the source directory | |
CONDA_BUILD_ROOT=/tmp/conda-build | |
mkdir -p $CONDA_BUILD_ROOT | |
# Capture the package path without building | |
PACKAGE_PATH=$(conda run -n build-env conda build --no-test \ | |
-c qiime2 -c conda-forge -c bioconda -c pytorch -c defaults \ | |
--croot $CONDA_BUILD_ROOT \ | |
ci/recipe --output) | |
# Build the package using the specified build root | |
conda run -n build-env conda build --no-test \ | |
-c qiime2 -c conda-forge -c bioconda -c pytorch -c defaults \ | |
--croot $CONDA_BUILD_ROOT \ | |
ci/recipe | |
# Export the package path as an output variable | |
echo "package_path=$PACKAGE_PATH" >> $GITHUB_OUTPUT | |
- name: Upload Package to Anaconda | |
env: | |
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
ANACONDA_USER: adamova | |
run: | | |
# Upload the built package using the captured path | |
conda run -n build-env anaconda upload "${{ steps.build.outputs.package_path }}" --user $ANACONDA_USER |