From d54271ec7ad290a4111e95a3a25443ae5f02542a Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Wed, 2 Jul 2025 22:16:26 -0400 Subject: [PATCH 1/3] build all supported Python versions using lessons from other conda fix --- .conda/conda_build_config.yaml | 5 --- .conda/meta.yaml | 2 +- .github/workflows/conda_build.yml | 60 ++++++++++++++++--------------- 3 files changed, 33 insertions(+), 34 deletions(-) delete mode 100644 .conda/conda_build_config.yaml diff --git a/.conda/conda_build_config.yaml b/.conda/conda_build_config.yaml deleted file mode 100644 index 4fe9a38c7b..0000000000 --- a/.conda/conda_build_config.yaml +++ /dev/null @@ -1,5 +0,0 @@ -python: - - 3.7 -numpy: - - 1.15 - diff --git a/.conda/meta.yaml b/.conda/meta.yaml index 03189a6ad2..576c76d09d 100644 --- a/.conda/meta.yaml +++ b/.conda/meta.yaml @@ -1,7 +1,7 @@ # For conda build package: name: rmgdatabase - version: {{ environ.get('GIT_DESCRIBE_TAG', '') }} + version: 3.3.0 source: path: ../ diff --git a/.github/workflows/conda_build.yml b/.github/workflows/conda_build.yml index 35ec3430ee..1cceee78b0 100644 --- a/.github/workflows/conda_build.yml +++ b/.github/workflows/conda_build.yml @@ -1,40 +1,42 @@ name: Conda Build +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: pull_request: + workflow_dispatch: push: branches: - stable jobs: build: + strategy: + fail-fast: false + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] runs-on: ubuntu-latest + name: Build Python ${{ matrix.python-version }} defaults: run: shell: bash -l {0} steps: - uses: actions/checkout@v4 - # Step to create a custom condarc.yml before setting up conda - - name: Create custom conda config file - run: | - RUNNER_CWD=$(pwd) - echo "channels:" > $RUNNER_CWD/condarc.yml - echo " - conda-forge" >> $RUNNER_CWD/condarc.yml - echo "show_channel_urls: true" >> $RUNNER_CWD/condarc.yml - - - name: Setup Conda + - name: Setup Miniforge uses: conda-incubator/setup-miniconda@v3 with: miniforge-variant: Miniforge3 miniforge-version: latest - use-mamba: true - condarc-file: condarc.yml - auto-update-conda: false - auto-activate-base: true + auto-update-conda: true + show-channel-urls: true + conda-remove-defaults: "true" + auto-activate-base: "true" activate-environment: "" - name: Install Build Tools - run: mamba install python anaconda-client conda-build conda-verify + run: conda install python anaconda-client conda-build - name: Configure Auto-Upload if: github.ref == 'refs/heads/stable' @@ -43,18 +45,20 @@ jobs: - name: Build Binary run: | - # Set the CONDA_TOKEN environment variable - if [ -z "${{ secrets.ANACONDA_TOKEN }}" ]; then - export CONDA_TOKEN="default_value" - else - export CONDA_TOKEN="${{ secrets.ANACONDA_TOKEN }}" - fi - + # set a default value to the conda_token if needed (like from forks) + : "${CONDA_TOKEN:=${{ secrets.ANACONDA_TOKEN }}}" + : "${CONDA_TOKEN:=default_value}" echo "CONDA_TOKEN=$CONDA_TOKEN" >> $GITHUB_ENV - - # Conditionally add the --token and --user flags for stable branches - if [[ "${GITHUB_REF}" == "refs/heads/stable" ]]; then - conda-build --token "$CONDA_TOKEN" --user rmg .conda - else - conda-build .conda - fi + conda config --add channels rmg + conda config --add channels conda-forge + CONDA_PY=${{ matrix.python-version }} conda build --token $CONDA_TOKEN --user rmg . + + result: + if: ${{ always() }} + runs-on: ubuntu-latest + name: Final Results + needs: [build] + steps: + - run: exit 1 + # see https://github.com/orgs/community/discussions/26822?sort=new#discussioncomment-8285141 + if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} From 0997ace11992efc7fe4477cc96973f85718e5555 Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Tue, 8 Jul 2025 17:07:45 -0400 Subject: [PATCH 2/3] python 3.13 doesn't include setuptools, skip it --- .github/workflows/conda_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda_build.yml b/.github/workflows/conda_build.yml index 1cceee78b0..80c756e156 100644 --- a/.github/workflows/conda_build.yml +++ b/.github/workflows/conda_build.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] runs-on: ubuntu-latest name: Build Python ${{ matrix.python-version }} defaults: From de28774aa04400eff2ff0ce87ac1e75e8d26c240 Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Tue, 8 Jul 2025 17:55:07 -0400 Subject: [PATCH 3/3] remove pointless quotes --- .github/workflows/conda_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conda_build.yml b/.github/workflows/conda_build.yml index 80c756e156..a72727bda0 100644 --- a/.github/workflows/conda_build.yml +++ b/.github/workflows/conda_build.yml @@ -31,8 +31,8 @@ jobs: miniforge-version: latest auto-update-conda: true show-channel-urls: true - conda-remove-defaults: "true" - auto-activate-base: "true" + conda-remove-defaults: true + auto-activate-base: true activate-environment: "" - name: Install Build Tools