forked from apache/arrow-adbc
-
Notifications
You must be signed in to change notification settings - Fork 0
1099 lines (964 loc) · 32.6 KB
/
packaging.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Packaging
on:
pull_request:
branches:
- main
paths:
- ".env"
- "c/**"
- "ci/**"
- "glib/**"
- "python/**"
- "ruby/**"
- ".github/workflows/packaging.yml"
push:
# Automatically build on RC tags
branches-ignore:
- "**"
tags:
- "apache-arrow-adbc-*-rc*"
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
upload_artifacts:
description: "Upload artifacts to Gemfury"
required: true
type: boolean
default: false
concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
source:
name: Source
runs-on: ubuntu-latest
# For cron: only run on the main repo, not forks
if: github.event_name != 'schedule' || github.repository == 'apache/arrow-adbc'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
submodules: recursive
# https://github.com/actions/checkout/issues/882
- name: Update tags
run: |
git fetch --tags --force origin
- name: Prepare version
run: |
source dev/release/versions.env
echo "VERSION=${RELEASE}" | tee -a $GITHUB_ENV
- name: Create archive
run: |
ci/scripts/source_build.sh \
apache-arrow-adbc-${VERSION} \
$(git log -n 1 --format=%h)
- uses: actions/upload-artifact@v4
with:
name: source
retention-days: 7
path: |
apache-arrow-adbc-*.tar.gz
go-binaries:
name: "Go ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
needs:
- source
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-13"]
go-version: [1.21.8] # Customize Go versions as needed
steps:
- uses: actions/download-artifact@v4
with:
name: source
- name: Extract source archive
run: |
source_archive=$(echo apache-arrow-adbc-*.tar.gz)
VERSION=${source_archive#apache-arrow-adbc-}
VERSION=${VERSION%.tar.gz}
echo "VERSION=${VERSION}" >> $GITHUB_ENV
tar xf apache-arrow-adbc-${VERSION}.tar.gz
mv apache-arrow-adbc-${VERSION} adbc
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
cache: true
cache-dependency-path: adbc/go/adbc/go.sum
# run `make -i` because the Windows runs claim they can't delete the .h files, but they are still generated
- name: Build Go binaries
run: |
pushd adbc/go/adbc/pkg
make -i
popd
- name: Upload Go binaries
uses: actions/upload-artifact@v3
with:
retention-days: 7
path: |
adbc/go/adbc/pkg/libadbc_driver_flightsql.*
adbc/go/adbc/pkg/libadbc_driver_snowflake.*
csharp:
name: "C#/.NET"
runs-on: ubuntu-latest
needs:
- source
- go-binaries
steps:
- uses: actions/download-artifact@v4
with:
name: source
- name: Extract source archive
run: |
source_archive=$(echo apache-arrow-adbc-*.tar.gz)
VERSION=${source_archive#apache-arrow-adbc-}
VERSION=${VERSION%.tar.gz}
echo "VERSION=${VERSION}" >> $GITHUB_ENV
tar xf apache-arrow-adbc-${VERSION}.tar.gz
mv apache-arrow-adbc-${VERSION} adbc
- name: Show inputs
run: |
echo "upload_artifacts: ${{ inputs.upload_artifacts }}" >> $GITHUB_STEP_SUMMARY
echo "schedule: ${{ github.event.schedule }}" >> $GITHUB_STEP_SUMMARY
echo "ref: ${{ github.ref }}" >> $GITHUB_STEP_SUMMARY
- uses: actions/download-artifact@v3
with:
path: adbc/go/adbc/pkg
- name: Copy Go binaries
run: |
pushd adbc/go/adbc/pkg/artifact
cp *.dll ../
cp *.so ../
cp *.dylib ../
popd
- name: Package
run: |
pushd adbc/
docker compose run -e IsPackagingPipeline=true csharp-dist
popd
- name: Archive nupkg
uses: actions/upload-artifact@v4
with:
name: csharp
retention-days: 7
path: |
adbc/csharp/artifacts/**/*.nupkg
adbc/csharp/artifacts/**/*.snupkg
docs:
name: Documentation
runs-on: ubuntu-latest
needs:
- source
steps:
- uses: actions/download-artifact@v4
with:
name: source
- name: Extract source archive
run: |
source_archive=$(echo apache-arrow-adbc-*.tar.gz)
VERSION=${source_archive#apache-arrow-adbc-}
VERSION=${VERSION%.tar.gz}
echo "VERSION=${VERSION}" | tee -a $GITHUB_ENV
tar xf apache-arrow-adbc-${VERSION}.tar.gz
mv apache-arrow-adbc-${VERSION} adbc
- name: Show inputs
run: |
echo "upload_artifacts: ${{ inputs.upload_artifacts }}" >> $GITHUB_STEP_SUMMARY
echo "schedule: ${{ github.event.schedule }}" >> $GITHUB_STEP_SUMMARY
echo "ref: ${{ github.ref }}" >> $GITHUB_STEP_SUMMARY
- name: Build and test
run: |
pushd adbc
docker compose run \
-e SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION \
docs
popd
- name: Compress docs
run: |
pushd adbc
tar --transform "s|docs/build/html|adbc-docs|" -czf ../docs.tgz docs/build/html
popd
- name: Archive docs
uses: actions/upload-artifact@v4
with:
name: docs
retention-days: 2
path: |
docs.tgz
java:
name: "Java 1.8"
runs-on: ubuntu-latest
needs:
- source
steps:
- uses: actions/download-artifact@v4
with:
name: source
- name: Extract source archive
run: |
source_archive=$(echo apache-arrow-adbc-*.tar.gz)
VERSION=${source_archive#apache-arrow-adbc-}
VERSION=${VERSION%.tar.gz}
echo "VERSION=${VERSION}" >> $GITHUB_ENV
tar xf apache-arrow-adbc-${VERSION}.tar.gz
mv apache-arrow-adbc-${VERSION} adbc
- name: Show inputs
run: |
echo "upload_artifacts: ${{ inputs.upload_artifacts }}" >> $GITHUB_STEP_SUMMARY
echo "schedule: ${{ github.event.schedule }}" >> $GITHUB_STEP_SUMMARY
echo "ref: ${{ github.ref }}" >> $GITHUB_STEP_SUMMARY
- name: Build and test
run: |
pushd adbc/
docker compose run java-dist
popd
cp -a adbc/dist/ ./
- name: Archive JARs
uses: actions/upload-artifact@v4
with:
name: java
retention-days: 7
path: |
dist/*.jar
dist/*.pom
linux:
name: Linux ${{ matrix.target }}
runs-on: ubuntu-latest
needs:
- source
strategy:
fail-fast: false
matrix:
target:
- almalinux-8
- almalinux-9
- debian-bookworm
- ubuntu-jammy
steps:
- uses: actions/download-artifact@v4
with:
name: source
- uses: actions/checkout@v4
with:
repository: apache/arrow
path: arrow
- name: Set output variables
run: |
echo "ARROW_SOURCE=$(pwd)/arrow" >> $GITHUB_ENV
case ${{ matrix.target }} in
almalinux-*)
echo "TASK_NAMESPACE=yum" >> $GITHUB_ENV
echo "YUM_TARGETS=${{ matrix.target }}" >> $GITHUB_ENV
;;
debian-*|ubuntu-*)
echo "TASK_NAMESPACE=apt" >> $GITHUB_ENV
echo "APT_TARGETS=${{ matrix.target }}" >> $GITHUB_ENV
;;
esac
distribution=$(echo ${{ matrix.target }} | cut -d- -f1)
echo "DISTRIBUTION=${distribution}" >> $GITHUB_ENV
source_archive=$(echo apache-arrow-adbc-*.tar.gz)
VERSION=${source_archive#apache-arrow-adbc-}
VERSION=${VERSION%.tar.gz}
echo "VERSION=${VERSION}" | tee -a $GITHUB_ENV
- name: Extract source archive
run: |
tar xf apache-arrow-adbc-$VERSION.tar.gz
source ./apache-arrow-adbc-$VERSION/dev/release/versions.env
mv apache-arrow-adbc-$VERSION adbc
mv apache-arrow-adbc-$VERSION.tar.gz adbc/ci/linux-packages/
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby
- name: Cache ccache
uses: actions/cache@v4
with:
path: adbc/ci/linux-packages/${{ env.TASK_NAMESPACE }}/build/${{ matrix.target }}/ccache
key: linux-${{ env.TASK_NAMESPACE }}-ccache-${{ matrix.target }}-{{ "${{ hashFiles('adbc.h', 'c/**', 'glib/**') }}" }}
restore-keys: linux-${{ env.TASK_NAMESPACE }}-ccache-${{ matrix.target }}-
- name: Login to GitHub Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build
run: |
pushd adbc/ci/linux-packages
if [ "${GITHUB_REF_TYPE}" != "tag" ]; then
rake version:update
fi
rake docker:pull || :
rake --trace ${TASK_NAMESPACE}:build BUILD_DIR=build
popd
- name: Prepare artifacts
run: |
cp -a \
adbc/ci/linux-packages/${{ env.TASK_NAMESPACE }}/repositories/${DISTRIBUTION} \
./
tar czf ${{ matrix.target }}.tar.gz ${DISTRIBUTION}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
retention-days: 7
path: |
${{ matrix.target }}.tar.gz
- name: Push Docker image
run: |
pushd adbc/ci/linux-packages
rake docker:push || :
popd
- name: Set up test
run: |
sudo apt update
sudo apt install -y \
apt-utils \
createrepo-c \
devscripts \
gpg \
rpm
gem install apt-dists-merge
(echo "Key-Type: RSA"; \
echo "Key-Length: 4096"; \
echo "Name-Real: Test"; \
echo "Name-Email: test@example.com"; \
echo "%no-protection") | \
gpg --full-generate-key --batch
GPG_KEY_ID=$(gpg --list-keys --with-colon test@example.com | grep fpr | cut -d: -f10)
echo "GPG_KEY_ID=${GPG_KEY_ID}" >> ${GITHUB_ENV}
gpg --export --armor test@example.com > adbc/ci/linux-packages/KEYS
- name: Test
run: |
pushd adbc/ci/linux-packages
rake --trace ${TASK_NAMESPACE}:test
popd
python-conda-linux:
name: "Python ${{ matrix.arch }} Conda"
runs-on: ubuntu-latest
# No need for Conda packages during release
# if: "!startsWith(github.ref, 'refs/tags/')"
# TODO(apache/arrow-adbc#468): disable for now
if: false
needs:
- source
strategy:
fail-fast: false
matrix:
# TODO: "linux_aarch64_"
arch: ["linux_64_"]
steps:
- uses: actions/download-artifact@v4
with:
name: source
- name: Extract source archive
id: version
run: |
source_archive=$(echo apache-arrow-adbc-*.tar.gz)
VERSION=${source_archive#apache-arrow-adbc-}
VERSION=${VERSION%.tar.gz}
echo "VERSION=${VERSION}" | tee -a $GITHUB_ENV
tar xf apache-arrow-adbc-${VERSION}.tar.gz
mv apache-arrow-adbc-${VERSION} adbc
- name: Show inputs
run: |
echo "upload_artifacts: ${{ github.event.inputs.upload_artifacts }}" >> $GITHUB_STEP_SUMMARY
echo "schedule: ${{ github.event.schedule }}" >> GITHUB_STEP_SUMMARY
echo "ref: ${{ github.ref }}" >> GITHUB_STEP_SUMMARY
- name: Build Conda package
env:
ARCH_CONDA_FORGE: ${{ matrix.arch }}
run: |
pushd adbc
docker compose run \
-e HOST_USER_ID=$(id -u) \
python-conda
popd
- name: Archive Conda packages
uses: actions/upload-artifact@v4
with:
name: python-${{ matrix.arch }}-conda
retention-days: 7
path: |
adbc/build/conda/*/*.tar.bz2
- name: Test Conda packages
if: matrix.arch == 'linux_64_'
env:
ARCH_CONDA_FORGE: ${{ matrix.arch }}
run: |
pushd adbc
docker compose run \
python-conda-test
popd
python-conda-macos:
name: "Python ${{ matrix.arch }} Conda"
runs-on: macos-13
# No need for Conda packages during release
# TODO(apache/arrow-adbc#468): re-enable
if: false
needs:
- source
strategy:
fail-fast: false
matrix:
# TODO: "osx_arm64_"
arch: ["osx_64_"]
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/download-artifact@v4
with:
name: source
- name: Extract source archive
id: version
run: |
source_archive=$(echo apache-arrow-adbc-*.tar.gz)
VERSION=${source_archive#apache-arrow-adbc-}
VERSION=${VERSION%.tar.gz}
echo "VERSION=${VERSION}" | tee -a $GITHUB_ENV
tar xf apache-arrow-adbc-$VERSION.tar.gz
mv apache-arrow-adbc-$VERSION adbc
- name: Show inputs
run: |
echo "upload_artifacts: ${{ github.event.inputs.upload_artifacts }}" >> $GITHUB_STEP_SUMMARY
echo "schedule: ${{ github.event.schedule }}" >> $GITHUB_STEP_SUMMARY
echo "ref: ${{ github.ref }}" >> $GITHUB_STEP_SUMMARY
- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-only-tar-bz2: false
use-mamba: true
- name: Install Dependencies
run: |
mamba install -c conda-forge boa conda-smithy conda-verify
conda config --remove channels defaults
conda config --add channels conda-forge
- name: Build Conda package
env:
ARCH_CONDA_FORGE: ${{ matrix.arch }}
run: |
./adbc/ci/scripts/python_conda_build.sh $(pwd)/adbc ${ARCH_CONDA_FORGE}.yaml $(pwd)/adbc/build
- name: Archive Conda packages
uses: actions/upload-artifact@v4
with:
name: python-${{ matrix.arch }}-conda
retention-days: 7
path: |
adbc/build/conda/*/*.tar.bz2
- name: Test Conda packages
if: matrix.arch == 'osx_64_'
env:
ARCH_CONDA_FORGE: ${{ matrix.arch }}
run: |
./adbc/ci/scripts/python_conda_test.sh $(pwd)/adbc $(pwd)/adbc/build
python-manylinux:
name: "Python ${{ matrix.arch }} manylinux${{ matrix.manylinux_version }}"
runs-on: ubuntu-latest
needs:
- source
strategy:
fail-fast: false
matrix:
arch: ["amd64", "arm64v8"]
is_pr:
- ${{ startsWith(github.ref, 'refs/pull/') }}
exclude:
# Don't run arm64v8 build on PRs since the build is excessively slow
- arch: arm64v8
is_pr: true
include:
- {arch: amd64, platform: linux/amd64}
- {arch: arm64v8, platform: linux/arm64}
steps:
- uses: actions/download-artifact@v4
with:
name: source
- name: Extract source archive
id: version
run: |
source_archive=$(echo apache-arrow-adbc-*.tar.gz)
VERSION=${source_archive#apache-arrow-adbc-}
VERSION=${VERSION%.tar.gz}
tar xf apache-arrow-adbc-${VERSION}.tar.gz
mv apache-arrow-adbc-${VERSION} adbc
source adbc/dev/release/versions.env
echo "VERSION=${VERSION_NATIVE}" | tee -a $GITHUB_ENV
- name: Show inputs
run: |
echo "upload_artifacts: ${{ github.event.inputs.upload_artifacts }}" >> $GITHUB_STEP_SUMMARY
echo "schedule: ${{ github.event.schedule }}" >> $GITHUB_STEP_SUMMARY
echo "ref: ${{ github.ref }}" >> $GITHUB_STEP_SUMMARY
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build wheel
env:
ARCH: ${{ matrix.arch }}
run: |
pushd adbc
docker compose run \
-e SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION \
python-wheel-manylinux
popd
- name: Archive wheels
uses: actions/upload-artifact@v4
with:
name: python-${{ matrix.arch }}-manylinux${{ matrix.manylinux_version }}
retention-days: 7
path: |
adbc/python/adbc_driver_flightsql/repaired_wheels/*.whl
adbc/python/adbc_driver_manager/repaired_wheels/*.whl
adbc/python/adbc_driver_postgresql/repaired_wheels/*.whl
adbc/python/adbc_driver_sqlite/repaired_wheels/*.whl
adbc/python/adbc_driver_snowflake/repaired_wheels/*.whl
- name: Test wheel 3.9
env:
ARCH: ${{ matrix.arch }}
PLATFORM: ${{ matrix.platform }}
run: |
pushd adbc
env PYTHON=3.9 docker compose run python-wheel-manylinux-test
- name: Test wheel 3.10
env:
ARCH: ${{ matrix.arch }}
PLATFORM: ${{ matrix.platform }}
run: |
pushd adbc
env PYTHON=3.10 docker compose run python-wheel-manylinux-test
- name: Test wheel 3.11
env:
ARCH: ${{ matrix.arch }}
PLATFORM: ${{ matrix.platform }}
run: |
pushd adbc
env PYTHON=3.11 docker compose run python-wheel-manylinux-test
- name: Test wheel 3.12
env:
ARCH: ${{ matrix.arch }}
PLATFORM: ${{ matrix.platform }}
run: |
pushd adbc
env PYTHON=3.12 docker compose run python-wheel-manylinux-test
python-macos:
name: "Python ${{ matrix.arch }} macOS"
runs-on: ${{ matrix.os }}
needs:
- source
strategy:
fail-fast: false
matrix:
os: ["macos-13", "macos-latest"]
include:
- os: macos-13
arch: amd64
- os: macos-latest
arch: arm64v8
env:
MACOSX_DEPLOYMENT_TARGET: "10.15"
PYTHON: "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10"
# Where to install vcpkg
VCPKG_ROOT: "${{ github.workspace }}/vcpkg"
steps:
- uses: actions/download-artifact@v4
with:
name: source
- name: Extract source archive
id: version
run: |
source_archive=$(echo apache-arrow-adbc-*.tar.gz)
VERSION=${source_archive#apache-arrow-adbc-}
VERSION=${VERSION%.tar.gz}
tar xf apache-arrow-adbc-${VERSION}.tar.gz
mv apache-arrow-adbc-${VERSION} adbc
source adbc/dev/release/versions.env
echo "VERSION=${VERSION_NATIVE}" | tee -a $GITHUB_ENV
echo "SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION_NATIVE}" | tee -a $GITHUB_ENV
- name: Show inputs
run: |
echo "upload_artifacts: ${{ github.event.inputs.upload_artifacts }}" >> $GITHUB_STEP_SUMMARY
echo "schedule: ${{ github.event.schedule }}" >> $GITHUB_STEP_SUMMARY
echo "ref: ${{ github.ref }}" >> $GITHUB_STEP_SUMMARY
- name: Install Homebrew dependencies
run: brew install autoconf bash pkg-config ninja
- name: Retrieve VCPKG version from .env
id: vcpkg_version
run: |
pushd adbc
vcpkg_version=$(cat ".env" | grep "VCPKG" | cut -d "=" -f2 | tr -d '"')
echo "VCPKG_VERSION=$vcpkg_version" | tee -a "$GITHUB_ENV"
popd
- name: Install vcpkg
run: |
pushd adbc
ci/scripts/install_vcpkg.sh $VCPKG_ROOT $VCPKG_VERSION
popd
- uses: actions/setup-go@v5
with:
go-version: 1.21.8
check-latest: true
cache: true
cache-dependency-path: adbc/go/adbc/go.sum
- name: Install Python (AMD64 only)
if: matrix.arch == 'amd64'
run: |
pushd adbc
sudo ci/scripts/install_python.sh macos 3.9
popd
- name: Install Python
run: |
pushd adbc
sudo ci/scripts/install_python.sh macos 3.10
sudo ci/scripts/install_python.sh macos 3.11
sudo ci/scripts/install_python.sh macos 3.12
popd
- name: Build wheel
env:
ARCH: ${{ matrix.arch }}
run: |
pushd adbc
$PYTHON -m venv build-env
source build-env/bin/activate
./ci/scripts/python_wheel_unix_build.sh $ARCH $(pwd) $(pwd)/build
popd
- name: Archive wheels
uses: actions/upload-artifact@v4
with:
name: python-${{ matrix.arch }}-macos
retention-days: 7
path: |
adbc/python/adbc_driver_flightsql/repaired_wheels/*.whl
adbc/python/adbc_driver_manager/repaired_wheels/*.whl
adbc/python/adbc_driver_postgresql/repaired_wheels/*.whl
adbc/python/adbc_driver_sqlite/repaired_wheels/*.whl
adbc/python/adbc_driver_snowflake/repaired_wheels/*.whl
- name: Test wheel 3.9
if: matrix.arch == 'amd64'
run: |
pushd adbc
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -m venv test-env-39
source test-env-39/bin/activate
export PYTHON_VERSION=3.9
./ci/scripts/python_wheel_unix_test.sh $(pwd)
deactivate
- name: Test wheel 3.10
run: |
pushd adbc
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 -m venv test-env-310
source test-env-310/bin/activate
export PYTHON_VERSION=3.10
./ci/scripts/python_wheel_unix_test.sh $(pwd)
deactivate
- name: Test wheel 3.11
run: |
pushd adbc
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 -m venv test-env-311
source test-env-311/bin/activate
export PYTHON_VERSION=3.11
./ci/scripts/python_wheel_unix_test.sh $(pwd)
deactivate
- name: Test wheel 3.12
run: |
pushd adbc
/Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12 -m venv test-env-312
source test-env-312/bin/activate
export PYTHON_VERSION=3.12
./ci/scripts/python_wheel_unix_test.sh $(pwd)
deactivate
python-windows:
name: "Python ${{ matrix.python_version }} Windows"
runs-on: windows-latest
needs:
- source
strategy:
fail-fast: false
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12"]
env:
PYTHON_VERSION: "${{ matrix.python_version }}"
# Where to install vcpkg
VCPKG_ROOT: "${{ github.workspace }}\\vcpkg"
steps:
- uses: actions/download-artifact@v4
with:
name: source
- name: Extract source archive
shell: bash
id: version
run: |
source_archive=$(echo apache-arrow-adbc-*.tar.gz)
VERSION=${source_archive#apache-arrow-adbc-}
VERSION=${VERSION%.tar.gz}
tar xf apache-arrow-adbc-${VERSION}.tar.gz
mv apache-arrow-adbc-${VERSION} adbc
source adbc/dev/release/versions.env
echo "VERSION=${VERSION_NATIVE}" | tee -a $GITHUB_ENV
(. adbc/.env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
- name: Show inputs
shell: pwsh
run: |
echo "upload_artifacts: ${{ inputs.upload_artifacts }}" >> $GITHUB_STEP_SUMMARY
echo "schedule: ${{ github.event.schedule }}" >> $GITHUB_STEP_SUMMARY
echo "ref: ${{ github.ref }}" >> $GITHUB_STEP_SUMMARY
- name: Install Chocolatey Dependencies
shell: pwsh
run: |
choco install --no-progress -y cmake --installargs 'ADD_CMAKE_TO_PATH=System'
choco install --no-progress -y visualcpp-build-tools
- name: Retrieve VCPKG version from .env
shell: pwsh
run: |
pushd adbc
Select-String -Path .env -Pattern 'VCPKG="(.+)"' | % {"VCPKG_VERSION=$($_.matches.groups[1])"} >> $env:GITHUB_ENV
popd
- name: Install vcpkg
shell: pwsh
run: |
echo $env:VCPKG_VERSION
git clone --shallow-since=2022-06-01 https://github.com/microsoft/vcpkg $env:VCPKG_ROOT
pushd $env:VCPKG_ROOT
.\bootstrap-vcpkg.bat -disableMetrics
popd
- uses: actions/setup-go@v5
with:
go-version: "${{ env.GO_VERSION }}"
check-latest: true
cache: true
cache-dependency-path: adbc/go/adbc/go.sum
- name: Install Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Build wheel
shell: cmd
run: |
where python.exe
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
pushd adbc
set SETUPTOOLS_SCM_PRETEND_VERSION=%VERSION%
.\ci\scripts\python_wheel_windows_build.bat %cd% %cd%\build
popd
- name: Archive wheels
uses: actions/upload-artifact@v4
with:
name: python${{ matrix.python_version }}-windows
retention-days: 7
path: |
adbc/python/adbc_driver_flightsql/repaired_wheels/*.whl
adbc/python/adbc_driver_manager/repaired_wheels/*.whl
adbc/python/adbc_driver_postgresql/repaired_wheels/*.whl
adbc/python/adbc_driver_sqlite/repaired_wheels/*.whl
adbc/python/adbc_driver_snowflake/repaired_wheels/*.whl
adbc/build/**/*.pdb
- name: Test wheel
shell: cmd
run: |
pushd adbc
where python.exe
python -m venv venv
CALL venv\Scripts\activate.bat
.\ci\scripts\python_wheel_windows_test.bat %cd%
popd
python-sdist:
name: "Python sdist"
runs-on: ubuntu-latest
needs:
- source
steps:
- uses: actions/download-artifact@v4
with:
name: source
- name: Extract source archive
run: |
source_archive=$(echo apache-arrow-adbc-*.tar.gz)
VERSION=${source_archive#apache-arrow-adbc-}
VERSION=${VERSION%.tar.gz}
tar xf apache-arrow-adbc-${VERSION}.tar.gz
mv apache-arrow-adbc-${VERSION} adbc
source adbc/dev/release/versions.env
echo "VERSION=${VERSION_NATIVE}" | tee -a $GITHUB_ENV
- name: Show inputs
run: |
echo "upload_artifacts: ${{ github.event.inputs.upload_artifacts }}"
echo "schedule: ${{ github.event.schedule }}"
echo "ref: ${{ github.ref }}"
- name: Build sdist
run: |
pushd adbc
docker compose run \
-e SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION \
python-sdist
popd
- name: Archive sdist
uses: actions/upload-artifact@v4
with:
name: python-sdist
retention-days: 7
path: |
adbc/python/adbc_driver_flightsql/dist/*.tar.gz
adbc/python/adbc_driver_manager/dist/*.tar.gz
adbc/python/adbc_driver_postgresql/dist/*.tar.gz
adbc/python/adbc_driver_sqlite/dist/*.tar.gz
adbc/python/adbc_driver_snowflake/dist/*.tar.gz
- name: Test sdist
run: |
pushd adbc
docker compose run python-sdist-test
popd
release:
name: "Create release"
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- csharp
- docs
- source
- java
- linux
- python-manylinux
- python-macos
- python-windows
- python-sdist
steps:
- name: Get All Artifacts
uses: actions/download-artifact@v4
with:
path: release-artifacts
- name: Release
run: |
RELEASE_TAG=${GITHUB_REF#refs/*/}
# Deduplicate wheels built in different jobs with same tag
# Include .pdb files since those are debug symbols for Windows
# wheels
mkdir -p upload-staging
find ./release-artifacts/ \
'(' \
-name docs.tgz -or \
-name '*.jar' -or \
-name '*.nupkg' -or \
-name '*.snupkg' -or \
-name '*.pdb' -or \
-name '*.pom' -or \
-name '*.whl' -or \
-name 'adbc_*.tar.gz' -or \
-name 'almalinux-*.tar.gz' -or \
-name 'apache-arrow-adbc-*.tar.gz' -or \
-name 'debian-*.tar.gz' -or \
-name 'ubuntu-*.tar.gz' \
')' \