-
Notifications
You must be signed in to change notification settings - Fork 30
145 lines (137 loc) · 5.14 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Community Extension Build
on:
pull_request:
paths-ignore:
- '**'
- '!scripts/build.py'
- '!.github/workflows/build.yml'
- '!extensions/*/description.yml'
push:
paths-ignore:
- '**'
- '!scripts/build.py'
- '!.github/workflows/build.yml'
- '!extensions/*/description.yml'
workflow_dispatch:
inputs:
extension_name:
type: string
duckdb_version:
type: string
duckdb_tag:
type: string
deploy:
type: string
more_excluded:
type: string
skip_tests:
required: false
type: boolean
default: false
workflow_call:
inputs:
extension_name:
type: string
duckdb_version:
type: string
duckdb_tag:
type: string
deploy:
type: string
more_excluded:
type: string
skip_tests:
required: false
type: boolean
default: false
jobs:
prepare:
outputs:
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: ${{ inputs.more_excluded }}${{ steps.parse.outputs.COMMUNITY_EXTENSION_EXCLUDE_PLATFORMS }}
COMMUNITY_EXTENSION_REQUIRES_TOOLCHAINS: ${{ steps.parse.outputs.COMMUNITY_EXTENSION_REQUIRES_TOOLCHAINS }}
COMMUNITY_EXTENSION_VCPKG_URL: ${{ steps.parse.outputs.COMMUNITY_EXTENSION_VCPKG_URL == '' && 'https://github.com/microsoft/vcpkg.git' || steps.parse.outputs.COMMUNITY_EXTENSION_VCPKG_URL }}
COMMUNITY_EXTENSION_VCPKG_COMMIT: ${{ steps.parse.outputs.COMMUNITY_EXTENSION_VCPKG_COMMIT == '' && 'a1a1cbc975abf909a6c8985a6a2b8fe20bbd9bd6' || steps.parse.outputs.COMMUNITY_EXTENSION_VCPKG_COMMIT }}
env:
DUCKDB_LATEST_STABLE: 'v1.1.3'
DUCKDB_VERSION: ${{ inputs.duckdb_version || 'v1.1.3' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get all changed description files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
extensions/*/description.yml
- name: Parse description files
id: parse
env:
ALL_CHANGED_FILES: ${{ github.event_name == 'workflow_dispatch' && format('extensions/{0}/description.yml', inputs.extension_name) || steps.changed-files.outputs.all_changed_files }}
PIP_BREAK_SYSTEM_PACKAGES: 1
run: |
pip install pyyaml
# scripts/build.py takes DUCKDB_VERSION from environment
python scripts/build.py
cat env.sh >> $GITHUB_OUTPUT
echo `cat $GITHUB_OUTPUT`
build:
needs: prepare
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main
if: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_NAME != '' }}
with:
duckdb_version: ${{ inputs.duckdb_version || 'v1.1.3' }}
duckdb_tag: ${{ inputs.duckdb_tag || '' }}
ci_tools_version: 'main'
exclude_archs: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_EXCLUDE_PLATFORMS }}
extra_toolchains: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_REQUIRES_TOOLCHAINS }}
extension_name: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_NAME }}
override_repository: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_GITHUB }}
override_ref: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_REF }}
vcpkg_url: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_VCPKG_URL}}
vcpkg_commit: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_VCPKG_COMMIT}}
skip_tests: ${{ inputs.skip_tests || false }}
doc_test:
if: ${{ inputs.deploy != 'false' }}
needs:
- prepare
- build
uses: ./.github/workflows/generate_docs.yml
with:
extension_name: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_NAME }}
archive:
needs:
- doc_test
- prepare
- build
uses: ./.github/workflows/_extension_archive.yml
if: ${{ (github.head_ref || github.ref_name) == 'main' }}
secrets: inherit
with:
extension_name: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_NAME }}
repository: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_GITHUB }}
ref: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_REF }}
deploy:
needs:
- prepare
- build
uses: ./.github/workflows/_extension_deploy.yml
if: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_DEPLOY != '' }}
secrets: inherit
with:
deploy_latest: true
duckdb_version: ${{ inputs.duckdb_version || 'v1.1.3' }}
exclude_archs: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_EXCLUDE_PLATFORMS }}
extension_name: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_NAME }}
repository: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_GITHUB }}
ref: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_REF }}
docs_all:
if: ${{ (github.head_ref || github.ref_name) == 'main' }}
needs:
- deploy
uses: ./.github/workflows/generate_docs.yml