generated from bokulich-lab/q2-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (45 loc) · 1.76 KB
/
build_n_upload_package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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