From 32ab121bbf2146ff4863af948534d24e1514667b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20M=C3=BChleisen?= Date: Mon, 3 Jun 2024 13:48:36 +0200 Subject: [PATCH] checkou --- .github/workflows/build.yml | 14 +++++++++++--- extensions/demo/description.yml | 2 +- scripts/build.py | 21 ++++++++++++++++++++- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f7f6312..a721231 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Get all changed description files - id: changed-description-files + id: changed-files uses: tj-actions/changed-files@v44 with: files: | @@ -19,11 +19,19 @@ jobs: - name: Parse description files env: - ALL_CHANGED_FILES: ${{ steps.changed-description-files.outputs.all_changed_files }} + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | - ls -R . + pip install pyyaml python scripts/build.py + - uses: actions/checkout@v4 + env: + with: + repository: ${{ env.COMMUNITY_EXTENSION_URL }} + ref: ${{ env.COMMUNITY_EXTENSION_REF }} + path: extension-build + fetch-depth: 0 + # - name: Build extension binaries # uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main # with: diff --git a/extensions/demo/description.yml b/extensions/demo/description.yml index 0669ce0..2f9f492 100644 --- a/extensions/demo/description.yml +++ b/extensions/demo/description.yml @@ -11,4 +11,4 @@ extension: repo: url: https://github.com/duckdb/extension-template - revision: a86093f6abd711620b49af29a7e621728d275e00 \ No newline at end of file + ref: a86093f6abd711620b49af29a7e621728d275e00 \ No newline at end of file diff --git a/scripts/build.py b/scripts/build.py index fab655f..89e1de4 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -1,2 +1,21 @@ import os -print(os.environ['ALL_CHANGED_FILES']) \ No newline at end of file +import yaml + +# TODO: check prefix, needs to be in installation dir + +desc_files = os.environ['ALL_CHANGED_FILES'].split(' ') +if len(desc_files) != 1: + raise ValueError('cannot have multiple descriptors changed or packages with spaces in their names') +desc_file = desc_files[0] + +with open(desc_file, 'r') as stream: + desc = yaml.safe_load(stream) + +print(desc) + +# todo check other stuff like build system etc. + + +os.environ['COMMUNITY_EXTENSION_URL'] = desc['repo']['url'] +os.environ['COMMUNITY_EXTENSION_REVISION'] = desc['repo']['revision'] +os.environ['COMMUNITY_EXTENSION_NAME'] = desc['extension']['name'] \ No newline at end of file