@@ -17,105 +17,32 @@ jobs:
1717 - uses : actions/checkout@v4
1818 with :
1919 fetch-depth : 0
20+
2021 - name : Conda environment creation and activation
2122 uses : conda-incubator/setup-miniconda@v3
2223 with :
2324 python-version : ${{ matrix.python-version }}
24- environment-file : .conda-envs/build-env.yaml # Path to the build conda environment
25+ environment-file : .conda-envs/build-env.yaml
2526 auto-update-conda : false
2627 auto-activate-base : false
2728 show-channel-urls : true
2829
29- - name : Install conda-build and anaconda-client
30- run : |
31- conda config --add channels conda-forge
32- conda install conda-build anaconda-client anaconda-auth -y
33-
34- - name : Set version environment variable
35- run : |
36- # Read version from version.txt file
37- VERSION=$(cat pyatlan/version.txt | tr -d ' \n')
38- echo "PYATLAN_VERSION=$VERSION" >> $GITHUB_ENV
39- echo "Building version: $VERSION"
40-
41- - name : Configure anaconda client
42- run : |
43- # Create config directory and file
44- mkdir -p /home/runner/.continuum/anaconda-client
45- cat > /home/runner/.continuum/anaconda-client/config.yaml << EOF
46- url: https://api.anaconda.org
47- EOF
48-
49- # Try to find anaconda command in various locations
50- ANACONDA_CMD=""
51- for cmd in anaconda "$CONDA/bin/anaconda" "$CONDA/condabin/anaconda" "$(which anaconda)"; do
52- if command -v "$cmd" >/dev/null 2>&1; then
53- ANACONDA_CMD="$cmd"
54- echo "Found anaconda command: $ANACONDA_CMD"
55- break
56- fi
57- done
58-
59- if [ -z "$ANACONDA_CMD" ]; then
60- echo "anaconda command not found. Trying to install via pip..."
61- pip install anaconda-client anaconda-auth
62- ANACONDA_CMD="anaconda"
63- fi
64-
65- echo "Using anaconda command: $ANACONDA_CMD"
66-
67- # Set up authentication token
68- echo "Setting up authentication..."
69- $ANACONDA_CMD config --set url https://api.anaconda.org
70- echo "Authentication will be handled during upload with --token parameter"
71- - name : Build conda package
72- env :
73- PYATLAN_VERSION : ${{ env.PYATLAN_VERSION }}
30+ - name : Get version from version.txt
31+ id : get_version
7432 run : |
75- echo "Current directory: $(pwd)"
76- echo "Listing .conda-envs directory:"
77- ls -la .conda-envs/
78- echo "Creating output directory..."
79- mkdir -p /tmp/conda-builds
80- echo "Building conda package with version: $PYATLAN_VERSION"
81- conda build .conda-envs/meta.yaml --python ${{ matrix.python-version }} --output-folder /tmp/conda-builds --debug --package-format tar.bz2 || {
82- echo "Conda build failed. Checking for any output..."
83- ls -la /tmp/conda-builds/ || echo "No output directory"
84- exit 1
85- }
33+ PYATLAN_VERSION=$(cat pyatlan/version.txt | tr -d ' \n')
34+ echo "version=$PYATLAN_VERSION" >> $GITHUB_OUTPUT
35+ echo "PYATLAN_VERSION=$PYATLAN_VERSION" >> $GITHUB_ENV
36+ echo "Building version: $PYATLAN_VERSION"
8637
87- - name : Convert to all platforms
88- run : |
89- echo "Checking build output directory:"
90- ls -la /tmp/conda-builds/ || echo "Directory does not exist"
91- echo "Finding built packages..."
92- find /tmp/conda-builds -name "*.tar.bz2" || echo "No .tar.bz2 files found"
93- find /tmp/conda-builds -name "*.conda" || echo "No .conda files found"
94-
95- # Find the built package (prioritize .tar.bz2 since we force that format)
96- PACKAGE_PATH=$(find /tmp/conda-builds -name "*.tar.bz2" | head -1)
97- if [ -z "$PACKAGE_PATH" ]; then
98- PACKAGE_PATH=$(find /tmp/conda-builds -name "*.conda" | head -1)
99- fi
100- if [ -z "$PACKAGE_PATH" ]; then
101- echo "No package found to convert"
102- echo "Build may have failed. Check the build logs above."
103- exit 1
104- fi
105- echo "Found package: $PACKAGE_PATH"
106- conda convert -p all "$PACKAGE_PATH" -o /tmp/conda-builds
107-
108- - name : Upload to Anaconda
109- env :
110- ANACONDA_API_TOKEN : ${{ secrets.ANACONDA_API_TOKEN }}
111- run : |
112- # Find anaconda command
113- ANACONDA_CMD=$(which anaconda || echo "$CONDA/bin/anaconda")
114-
115- # Upload all platform packages
116- for pkg in /tmp/conda-builds/*/*.tar.bz2; do
117- if [ -f "$pkg" ]; then
118- echo "Uploading $pkg..."
119- $ANACONDA_CMD upload --user atlanhq --label main "$pkg"
120- fi
121- done
38+ - name : Build and upload the conda packages
39+ 40+ with :
41+ meta_yaml_dir : .conda-envs
42+ python-version : ${{ matrix.python-version }}
43+ platform_all : true
44+ user : atlanhq
45+ label : main
46+ token : ${{ secrets.ANACONDA_API_TOKEN }}
47+ upload : true
48+ version : ${{ steps.get_version.outputs.version }}
0 commit comments