From e66a0e8a751efd582ff68351f5ac860d8fb3ede1 Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Fri, 14 Jun 2024 16:19:17 +0200 Subject: [PATCH 1/2] If no changes to extensions directory, build quack --- .github/workflows/build.yml | 1 + scripts/build.py | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9cd8329..2d35640 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,6 +48,7 @@ jobs: - prepare - build uses: ./.github/workflows/_extension_deploy.yml + if: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_DEPLOY != '' }} secrets: inherit with: deploy_latest: true diff --git a/scripts/build.py b/scripts/build.py index 0bf4db1..d5d1360 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -14,13 +14,12 @@ if len(desc_files) > 1: raise ValueError('cannot have multiple descriptors changed or packages with spaces in their names') +deploy = True + 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) + print("No changed files, only quack will be built as a test") + desc_files = ['extensions/quack/description.yml'] + deploy = False desc_file = desc_files[0] @@ -35,3 +34,5 @@ hdl.write(f"COMMUNITY_EXTENSION_GITHUB={desc['repo']['github']}\n") hdl.write(f"COMMUNITY_EXTENSION_REF={desc['repo']['ref']}\n") hdl.write(f"COMMUNITY_EXTENSION_NAME={desc['extension']['name']}\n") + if deploy: + hdl.write(f"COMMUNITY_EXTENSION_DEPLOY=1\n") From 4c4e82dd10737e70acf390ae53ecc2458d90432e Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Thu, 13 Jun 2024 13:37:32 +0200 Subject: [PATCH 2/2] Add back all platforms, allowing custom extensions to skip some --- .github/workflows/build.yml | 6 ++++-- scripts/build.py | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d35640..b0be771 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,8 @@ jobs: COMMUNITY_EXTENSION_NAME: ${{ steps.parse.outputs.COMMUNITY_EXTENSION_NAME }} COMMUNITY_EXTENSION_GITHUB: ${{ steps.parse.outputs.COMMUNITY_EXTENSION_GITHUB }} COMMUNITY_EXTENSION_REF: ${{ steps.parse.outputs.COMMUNITY_EXTENSION_REF }} + COMMUNITY_EXTENSION_DEPLOY: ${{ steps.parse.outputs.COMMUNITY_EXTENSION_DEPLOY }} + COMMUNITY_EXTENSION_EXCLUDE_PLATFORMS: ${{ steps.parse.outputs.COMMUNITY_EXTENSION_EXCLUDE_PLATFORMS }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -38,8 +40,8 @@ jobs: if: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_NAME != '' }} with: duckdb_version: v1.0.0 + exclude_archs: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_EXCLUDE_PLATFORMS }} extension_name: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_NAME }} - exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_rtools' repository: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_GITHUB }} ref: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_REF }} @@ -53,8 +55,8 @@ jobs: with: deploy_latest: true duckdb_version: v1.0.0 + exclude_archs: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_EXCLUDE_PLATFORMS }} extension_name: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_NAME }} - exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_rtools' repository: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_GITHUB }} ref: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_REF }} diff --git a/scripts/build.py b/scripts/build.py index d5d1360..8c3bd66 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -34,5 +34,8 @@ hdl.write(f"COMMUNITY_EXTENSION_GITHUB={desc['repo']['github']}\n") hdl.write(f"COMMUNITY_EXTENSION_REF={desc['repo']['ref']}\n") hdl.write(f"COMMUNITY_EXTENSION_NAME={desc['extension']['name']}\n") + excluded_platforms = desc['extension'].get('excluded_platforms') + if excluded_platforms: + hdl.write(f"COMMUNITY_EXTENSION_EXCLUDE_PLATFORMS={excluded_platforms}\n") if deploy: hdl.write(f"COMMUNITY_EXTENSION_DEPLOY=1\n")