Skip to content

Commit

Permalink
Merge pull request #10 from samansmink/add-scrooge
Browse files Browse the repository at this point in the history
Add scrooge
  • Loading branch information
samansmink committed Jun 13, 2024
2 parents e27eec0 + 2a7a425 commit 4ca3f8f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
13 changes: 13 additions & 0 deletions extensions/scrooge/description.yml
Original file line number Diff line number Diff line change
@@ -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
24 changes: 19 additions & 5 deletions scripts/build.py
Original file line number Diff line number Diff line change
@@ -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)

Expand Down

0 comments on commit 4ca3f8f

Please sign in to comment.