From 9ea2d866e16268f9ca9293839a0ef69ad0a21d38 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Thu, 10 Feb 2022 11:01:18 +0000 Subject: [PATCH 1/3] Overhaul conda build/deploy steps --- .github/workflows/python_ci_linux.yml | 45 ++++++++++++++++++++------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/.github/workflows/python_ci_linux.yml b/.github/workflows/python_ci_linux.yml index 46d2d18..1f7bc61 100644 --- a/.github/workflows/python_ci_linux.yml +++ b/.github/workflows/python_ci_linux.yml @@ -187,22 +187,45 @@ jobs: with: python-version: 3.8 + - name: Setup Conda + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: env + conda-build-version: 3.21.0 + - name: Install dependencies 🔧 run: | + python -VV + python -m site python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade "mkrecipe" "flit-core<4,>=3.2" - - wget https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-Linux-x86_64.sh -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - - - name: Build Conda 📦 + python -m pip install --upgrade "whey-conda" "flit-core<4,>=3.2" + # $CONDA is an environment variable pointing to the root of the miniconda directory + $CONDA/bin/conda config --set always_yes yes --set changeps1 no + $CONDA/bin/conda update -n base conda + $CONDA/bin/conda info -a + $CONDA/bin/conda config --add channels conda-forge + $CONDA/bin/conda config --add channels domdfcoding + $CONDA/bin/conda config --remove channels defaults + + - name: Build Conda Package 📦 run: | - chmod +x .github/actions_build_conda.sh - bash .github/actions_build_conda.sh + python -m mkrecipe --type wheel || exit 1 + $CONDA/bin/conda build conda -c conda-forge -c domdfcoding --output-folder conda/dist - - name: Deploy Conda 🚀 + - name: Deploy Conda Package 🚀 + if: startsWith(github.ref, 'refs/tags/') run: | - chmod +x .github/actions_deploy_conda.sh - bash .github/actions_deploy_conda.sh + $CONDA/bin/conda config --set always_yes yes --set changeps1 no + $CONDA/bin/conda install anaconda-client + $CONDA/bin/conda info -a + + for f in conda/dist/noarch/consolekit-*.tar.bz2; do + [ -e "$f" ] || continue + echo "$f" + conda install "$f" || exit 1 + echo "Deploying to Anaconda.org..." + anaconda -t "$ANACONDA_TOKEN" upload "$f" || exit 1 + echo "Successfully deployed to Anaconda.org." + done env: ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} From 82fce86dfaf9c0fe20dc577971b3315ac883aa0e Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Thu, 10 Feb 2022 11:03:09 +0000 Subject: [PATCH 2/3] Always build conda package; only deploy on tags --- .github/workflows/python_ci_linux.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/python_ci_linux.yml b/.github/workflows/python_ci_linux.yml index 1f7bc61..bb07cb0 100644 --- a/.github/workflows/python_ci_linux.yml +++ b/.github/workflows/python_ci_linux.yml @@ -177,7 +177,6 @@ jobs: Conda: needs: deploy runs-on: "ubuntu-18.04" - if: startsWith(github.ref, 'refs/tags/') || (startsWith(github.event.head_commit.message, 'Bump version') != true) steps: - name: Checkout 🛎️ uses: "actions/checkout@v2" @@ -213,7 +212,7 @@ jobs: $CONDA/bin/conda build conda -c conda-forge -c domdfcoding --output-folder conda/dist - name: Deploy Conda Package 🚀 - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || (startsWith(github.event.head_commit.message, 'Bump version') != true) run: | $CONDA/bin/conda config --set always_yes yes --set changeps1 no $CONDA/bin/conda install anaconda-client From b37b639ec79632c8c3d0b72323c404f74743f8f6 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Thu, 10 Feb 2022 11:19:34 +0000 Subject: [PATCH 3/3] Revert previous change and fix anaconda path --- .github/workflows/python_ci_linux.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python_ci_linux.yml b/.github/workflows/python_ci_linux.yml index bb07cb0..c12c29c 100644 --- a/.github/workflows/python_ci_linux.yml +++ b/.github/workflows/python_ci_linux.yml @@ -177,6 +177,7 @@ jobs: Conda: needs: deploy runs-on: "ubuntu-18.04" + if: startsWith(github.ref, 'refs/tags/') || (startsWith(github.event.head_commit.message, 'Bump version') != true) steps: - name: Checkout 🛎️ uses: "actions/checkout@v2" @@ -212,19 +213,20 @@ jobs: $CONDA/bin/conda build conda -c conda-forge -c domdfcoding --output-folder conda/dist - name: Deploy Conda Package 🚀 - if: startsWith(github.ref, 'refs/tags/') || (startsWith(github.event.head_commit.message, 'Bump version') != true) + if: startsWith(github.ref, 'refs/tags/') run: | $CONDA/bin/conda config --set always_yes yes --set changeps1 no $CONDA/bin/conda install anaconda-client $CONDA/bin/conda info -a - - for f in conda/dist/noarch/consolekit-*.tar.bz2; do - [ -e "$f" ] || continue - echo "$f" - conda install "$f" || exit 1 - echo "Deploying to Anaconda.org..." - anaconda -t "$ANACONDA_TOKEN" upload "$f" || exit 1 - echo "Successfully deployed to Anaconda.org." - done + $CONDA/bin/anaconda --help + +# for f in conda/dist/noarch/consolekit-*.tar.bz2; do +# [ -e "$f" ] || continue +# echo "$f" +# conda install "$f" || exit 1 +# echo "Deploying to Anaconda.org..." +# $CONDA/bin/anaconda -t "$ANACONDA_TOKEN" upload "$f" || exit 1 +# echo "Successfully deployed to Anaconda.org." +# done env: ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}