Skip to content

Commit 61ea35e

Browse files
committed
ci: Try fix distribution
1 parent c4eae9c commit 61ea35e

3 files changed

Lines changed: 60 additions & 4 deletions

File tree

.github/workflows/Distribution.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
name: Main Extension Distribution Pipeline
22
on:
3+
pull_request:
4+
paths:
5+
- "CMakeLists.txt"
6+
- "Makefile"
7+
- "extension_config.cmake"
8+
- "vcpkg.json"
9+
- ".github/workflows/Distribution.yml"
310
push:
4-
tags:
5-
- "*"
6-
paths-ignore:
7-
- "**.md"
11+
branches:
12+
- "main"
13+
paths:
14+
- "CMakeLists.txt"
15+
- "Makefile"
16+
- "extension_config.cmake"
17+
- "vcpkg.json"
18+
- ".github/workflows/Distribution.yml"
19+
create:
820
workflow_dispatch:
921

1022
concurrency:
@@ -14,16 +26,20 @@ concurrency:
1426
jobs:
1527
duckdb-stable-build:
1628
name: Build extension binaries
29+
if: ${{ github.event_name != 'create' || github.event.ref_type == 'tag' }}
1730
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.4.3
1831
with:
1932
duckdb_version: v1.4.3
2033
ci_tools_version: v1.4.3
2134
extension_name: lance
2235
extra_toolchains: "rust"
2336
exclude_archs: "wasm_mvp;wasm_eh;wasm_threads;windows_amd64_mingw"
37+
test_config: >-
38+
{"test_env_variables":{"PROTOC":"/duckdb_build_dir/.ci/protoc"}}
2439
2540
release:
2641
name: Create GitHub release
42+
if: ${{ github.event_name == 'create' && github.event.ref_type == 'tag' }}
2743
runs-on: ubuntu-latest
2844
needs: duckdb-stable-build
2945
permissions:
@@ -38,5 +54,6 @@ jobs:
3854
- name: Publish GitHub release
3955
uses: softprops/action-gh-release@v2
4056
with:
57+
tag_name: ${{ github.ref_name }}
4158
files: artifacts/*
4259
generate_release_notes: true

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ endif
1212

1313
# Include the Makefile from extension-ci-tools
1414
include extension-ci-tools/makefiles/duckdb_extension.Makefile
15+
16+
.PHONY: configure_ci
17+
configure_ci:
18+
@bash scripts/configure_ci.sh

scripts/configure_ci.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
mkdir -p .ci
5+
6+
duckdb_platform="${DUCKDB_PLATFORM:-}"
7+
vcpkg_target_triplet="${VCPKG_TARGET_TRIPLET:-}"
8+
9+
if [[ -z "${vcpkg_target_triplet}" ]]; then
10+
echo "VCPKG_TARGET_TRIPLET is required to locate protoc from vcpkg." >&2
11+
exit 1
12+
fi
13+
14+
build_type="release"
15+
16+
is_windows=0
17+
case "${duckdb_platform}" in
18+
windows_*) is_windows=1 ;;
19+
esac
20+
21+
protoc_exe="protoc"
22+
if [[ "${is_windows}" -eq 1 ]]; then
23+
protoc_exe="protoc.exe"
24+
fi
25+
26+
protoc_rel="build/${build_type}/vcpkg_installed/${vcpkg_target_triplet}/tools/protobuf/${protoc_exe}"
27+
link_path=".ci/${protoc_exe}"
28+
29+
# Create a stable path for protoc. The target may not exist yet (vcpkg can install during build).
30+
ln -sf "../${protoc_rel}" "${link_path}"
31+
32+
if [[ -n "${GITHUB_ENV:-}" ]]; then
33+
repo_root="$(pwd)"
34+
printf "PROTOC=%s\n" "${repo_root}/${link_path}" >> "${GITHUB_ENV}"
35+
fi

0 commit comments

Comments
 (0)