Skip to content

Commit 411aa98

Browse files
committed
[fix/ci] use conda forge channel for packages
1 parent 2056b6c commit 411aa98

File tree

2 files changed

+32
-13
lines changed

2 files changed

+32
-13
lines changed

.conda-envs/build-env.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
channels: # write here the list of channels to look for your library dependencies
22
- atlanhq
33
- conda-forge
4-
- default
4+
- nodefaults
55

66
dependencies: # Keep this block with only these two packages
77
- anaconda-client

.github/workflows/build_and_upload_conda_packages.yaml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
auto-update-conda: false
2727
auto-activate-base: false
2828
show-channel-urls: true
29-
channels: conda-forge, defaults
30-
conda-remove-defaults: true
29+
channels: conda-forge
30+
conda-remove-defaults: "true"
3131

3232
- name: Get version from version.txt
3333
id: get_version
@@ -38,9 +38,6 @@ jobs:
3838
3939
- name: Install conda-build and anaconda-client
4040
run: |
41-
conda config --add channels conda-forge
42-
conda config --add channels defaults
43-
conda config --set auto_activate false
4441
conda install conda-build anaconda-client anaconda-auth -y
4542
4643
- name: Build conda package
@@ -59,10 +56,16 @@ jobs:
5956
exit 1
6057
fi
6158
echo "Found package: $PACKAGE_PATH"
62-
# Convert to specific architectures only
63-
conda convert -p win-64 "$PACKAGE_PATH" -o /tmp/conda-builds
64-
conda convert -p linux-64 "$PACKAGE_PATH" -o /tmp/conda-builds
65-
conda convert -p osx-64 "$PACKAGE_PATH" -o /tmp/conda-builds
59+
60+
# Check if it's a noarch package
61+
if [[ "$PACKAGE_PATH" == *"/noarch/"* ]]; then
62+
echo "Package is noarch, skipping conversion (already architecture-independent)"
63+
else
64+
# Convert to specific architectures only
65+
conda convert -p win-64 "$PACKAGE_PATH" -o /tmp/conda-builds
66+
conda convert -p linux-64 "$PACKAGE_PATH" -o /tmp/conda-builds
67+
conda convert -p osx-64 "$PACKAGE_PATH" -o /tmp/conda-builds
68+
fi
6669
6770
6871
- name: Upload to Anaconda
@@ -85,10 +88,26 @@ jobs:
8588
ANACONDA_CMD="anaconda"
8689
fi
8790
88-
# Upload all platform packages
91+
# Upload all packages, but handle noarch conflicts gracefully
8992
for pkg in /tmp/conda-builds/*/*.tar.bz2; do
9093
if [ -f "$pkg" ]; then
91-
echo "Uploading $pkg..."
92-
$ANACONDA_CMD upload --user atlanhq --label main "$pkg"
94+
echo "Attempting to upload $pkg..."
95+
# Capture the output to check for errors
96+
UPLOAD_OUTPUT=$($ANACONDA_CMD upload --user atlanhq --label main "$pkg" 2>&1)
97+
UPLOAD_EXIT_CODE=$?
98+
99+
echo "Upload output for $pkg:"
100+
echo "$UPLOAD_OUTPUT"
101+
echo "Exit code: $UPLOAD_EXIT_CODE"
102+
103+
if [ $UPLOAD_EXIT_CODE -eq 0 ]; then
104+
echo "Successfully uploaded: $pkg"
105+
elif echo "$UPLOAD_OUTPUT" | grep -q "already exists\|Conflict"; then
106+
echo "Package already exists, skipping: $pkg"
107+
else
108+
echo "Upload failed for $pkg (exit code: $UPLOAD_EXIT_CODE):"
109+
echo "$UPLOAD_OUTPUT"
110+
# Don't fail the build for upload errors, just log them
111+
fi
93112
fi
94113
done

0 commit comments

Comments
 (0)