diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 935d40b..a01a32c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,7 @@ jobs: build: needs: prepare uses: ./.github/workflows/_extension_distribution.yml + if: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_NAME != '' }} with: duckdb_version: v1.0.0 extension_name: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_NAME }} diff --git a/extensions/scrooge/description.yml b/extensions/scrooge/description.yml new file mode 100644 index 0000000..89777ec --- /dev/null +++ b/extensions/scrooge/description.yml @@ -0,0 +1,13 @@ +extension: + name: scrooge + description: Provides functionality for financial data-analysis + version: 0.0.1 + language: C++ + build: cmake + license: MIT + maintainers: + - pdet + +repo: + github: pdet/Scrooge-McDuck + ref: 9520aeba138a6bb43f766ed4f78accac026bfae0 \ No newline at end of file diff --git a/scripts/build.py b/scripts/build.py index 0e6e6e8..0bf4db1 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -1,17 +1,31 @@ import os +import sys import yaml # TODO: check prefix, needs to be in installation dir -desc_files = os.environ['ALL_CHANGED_FILES'].split(' ') -if len(desc_files) != 1: +if 'ALL_CHANGED_FILES' in os.environ: + desc_files = os.environ['ALL_CHANGED_FILES'].split(' ') +else: + desc_files = [] + +print(f"Files changed: {desc_files}") + +if len(desc_files) > 1: raise ValueError('cannot have multiple descriptors changed or packages with spaces in their names') + +if len(desc_files) == 0 or len(desc_files[0]) == 0: + print("No changed files, nothing will be built") + with open('env.sh', 'w+') as hdl: + hdl.write(f"COMMUNITY_EXTENSION_GITHUB=\n") + hdl.write(f"COMMUNITY_EXTENSION_REF=\n") + hdl.write(f"COMMUNITY_EXTENSION_NAME=\n") + sys.exit(os.EX_OK) + desc_file = desc_files[0] -if len(desc_file) == 0: - desc_file = 'extensions/quack/description.yml' with open(desc_file, 'r') as stream: - desc = yaml.safe_load(stream) + desc = yaml.safe_load(stream) print(desc)