Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .conda/conda_build_config.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# For conda build
package:
name: rmgdatabase
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
version: 3.3.0

source:
path: ../
Expand Down
58 changes: 31 additions & 27 deletions .github/workflows/conda_build.yml
Original file line number Diff line number Diff line change
@@ -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"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why test versions 3.7 and 3.8?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When conda builds a recipe using a certain version of Python, it makes that version of Python (down to the minor version) a requirement in order to install it.

By building against Python 3.7 up to 3.12, anyone on those versions of Python can install rmgdatabase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.7 and 3.8 are included because Old RMG 3.0 and 3.1 binaries exist, and could theoretically use the current version of RMG-database

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah got it thanks

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-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'
Expand All @@ -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') }}
Loading