Skip to content

Commit b4d7f51

Browse files
alinaliBQjusting-bq
authored andcommitted
Windows CI to Support ODBC DLL & MSI Signing
* Add draft code for CI A and CI B Attempt workflow dispatch Only ODBC Windows original workflow should run. Later need to add `github.event_name != 'workflow_dispatch' ||` to all existing workflows after uncomment Use `GITHUB_REF_NAME` directly via push Add `workflow_dispatch` definitions Add `ODBC Windows Upload DLL` Use common ODBC Windows environment variables Use ODBC as composite action Create cpp_odbc.yml Initial draft temp disable test step Temp disable non-ODBC Windows workflows * Clean Up Code * Remove comments * Fix Installer path for MSI Trigger CI Fix issue with `secrets.GITHUB_TOKEN` Change `odbc_msi_upload` to boolean input Change `odbc-msvc-upload-dll` to be triggered via rc tag and can be invoked manually Work on Bryce's code review comments
1 parent ca8a194 commit b4d7f51

4 files changed

Lines changed: 293 additions & 113 deletions

File tree

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: ODBC Windows Reusable
19+
inputs:
20+
github-token:
21+
description: 'GITHUB_TOKEN for vcpkg caching'
22+
required: true
23+
runs:
24+
using: "composite"
25+
steps:
26+
- name: Disable Crash Dialogs
27+
shell: pwsh
28+
run: |
29+
reg add `
30+
"HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" `
31+
/v DontShowUI `
32+
/t REG_DWORD `
33+
/d 1 `
34+
/f
35+
- name: Download Timezone Database
36+
shell: bash
37+
run: ci/scripts/download_tz_database.sh
38+
- name: Install ccache
39+
shell: bash
40+
run: |
41+
ci/scripts/install_ccache.sh 4.12.1 /usr
42+
- name: Setup ccache
43+
shell: bash
44+
run: |
45+
ci/scripts/ccache_setup.sh
46+
- name: ccache info
47+
id: ccache-info
48+
shell: bash
49+
run: |
50+
echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
51+
- name: Cache ccache
52+
uses: actions/cache@v5
53+
with:
54+
path: ${{ steps.ccache-info.outputs.cache-dir }}
55+
key: cpp-odbc-ccache-windows-x64-${{ hashFiles('cpp/**') }}
56+
restore-keys: cpp-odbc-ccache-windows-x64-
57+
- name: Checkout vcpkg
58+
uses: actions/checkout@v6
59+
with:
60+
persist-credentials: false
61+
fetch-depth: 0
62+
path: vcpkg
63+
repository: microsoft/vcpkg
64+
- name: Bootstrap vcpkg
65+
shell: pwsh
66+
run: |
67+
vcpkg\bootstrap-vcpkg.bat
68+
$VCPKG_ROOT = $(Resolve-Path -LiteralPath "vcpkg").ToString()
69+
Write-Output ${VCPKG_ROOT} | `
70+
Out-File -FilePath ${Env:GITHUB_PATH} -Encoding utf8 -Append
71+
Write-Output "VCPKG_ROOT=${VCPKG_ROOT}" | `
72+
Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
73+
- name: Setup NuGet credentials for vcpkg caching
74+
shell: bash
75+
run: |
76+
$(vcpkg fetch nuget | tail -n 1) \
77+
sources add \
78+
-source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" \
79+
-storepasswordincleartext \
80+
-name "GitHub" \
81+
-username "$GITHUB_REPOSITORY_OWNER" \
82+
-password "${{ inputs.github-token }}"
83+
$(vcpkg fetch nuget | tail -n 1) \
84+
setapikey "${{ inputs.github-token }}" \
85+
-source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json"
86+
- name: Build
87+
shell: cmd
88+
run: |
89+
set VCPKG_ROOT_KEEP=%VCPKG_ROOT%
90+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
91+
set VCPKG_ROOT=%VCPKG_ROOT_KEEP%
92+
bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build"
93+
- name: Register Flight SQL ODBC Driver
94+
shell: cmd
95+
run: |
96+
call "cpp\src\arrow\flight\sql\odbc\tests\install_odbc.cmd" ${{ github.workspace }}\build\cpp\%ARROW_BUILD_TYPE%\arrow_flight_sql_odbc.dll

.github/workflows/cpp_extra.yml

Lines changed: 4 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -559,81 +559,16 @@ jobs:
559559
VCPKG_BINARY_SOURCES: 'clear;nugettimeout,600;nuget,GitHub,readwrite'
560560
VCPKG_DEFAULT_TRIPLET: x64-windows
561561
steps:
562-
- name: Disable Crash Dialogs
563-
run: |
564-
reg add `
565-
"HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" `
566-
/v DontShowUI `
567-
/t REG_DWORD `
568-
/d 1 `
569-
/f
570562
- name: Checkout Arrow
571563
uses: actions/checkout@v6
572564
with:
573565
persist-credentials: false
574566
fetch-depth: 0
575567
submodules: recursive
576-
- name: Download Timezone Database
577-
shell: bash
578-
run: ci/scripts/download_tz_database.sh
579-
- name: Install ccache
580-
shell: bash
581-
run: |
582-
ci/scripts/install_ccache.sh 4.12.1 /usr
583-
- name: Setup ccache
584-
shell: bash
585-
run: |
586-
ci/scripts/ccache_setup.sh
587-
- name: ccache info
588-
id: ccache-info
589-
shell: bash
590-
run: |
591-
echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
592-
- name: Cache ccache
593-
uses: actions/cache@v5
568+
- name: Build ODBC Windows
569+
uses: ./.github/actions/odbc-windows
594570
with:
595-
path: ${{ steps.ccache-info.outputs.cache-dir }}
596-
key: cpp-odbc-ccache-windows-x64-${{ hashFiles('cpp/**') }}
597-
restore-keys: cpp-odbc-ccache-windows-x64-
598-
- name: Checkout vcpkg
599-
uses: actions/checkout@v6
600-
with:
601-
persist-credentials: false
602-
fetch-depth: 0
603-
path: vcpkg
604-
repository: microsoft/vcpkg
605-
- name: Bootstrap vcpkg
606-
run: |
607-
vcpkg\bootstrap-vcpkg.bat
608-
$VCPKG_ROOT = $(Resolve-Path -LiteralPath "vcpkg").ToString()
609-
Write-Output ${VCPKG_ROOT} | `
610-
Out-File -FilePath ${Env:GITHUB_PATH} -Encoding utf8 -Append
611-
Write-Output "VCPKG_ROOT=${VCPKG_ROOT}" | `
612-
Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
613-
- name: Setup NuGet credentials for vcpkg caching
614-
shell: bash
615-
run: |
616-
$(vcpkg fetch nuget | tail -n 1) \
617-
sources add \
618-
-source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" \
619-
-storepasswordincleartext \
620-
-name "GitHub" \
621-
-username "$GITHUB_REPOSITORY_OWNER" \
622-
-password "${{ secrets.GITHUB_TOKEN }}"
623-
$(vcpkg fetch nuget | tail -n 1) \
624-
setapikey "${{ secrets.GITHUB_TOKEN }}" \
625-
-source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json"
626-
- name: Build
627-
shell: cmd
628-
run: |
629-
set VCPKG_ROOT_KEEP=%VCPKG_ROOT%
630-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
631-
set VCPKG_ROOT=%VCPKG_ROOT_KEEP%
632-
bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build"
633-
- name: Register Flight SQL ODBC Driver
634-
shell: cmd
635-
run: |
636-
call "cpp\src\arrow\flight\sql\odbc\tests\install_odbc.cmd" ${{ github.workspace }}\build\cpp\%ARROW_BUILD_TYPE%\arrow_flight_sql_odbc.dll
571+
github-token: ${{ secrets.GITHUB_TOKEN }}
637572
- name: Test
638573
shell: cmd
639574
run: |
@@ -656,7 +591,7 @@ jobs:
656591
wix --version
657592
cd build/cpp
658593
cpack
659-
- name: Upload the artifacts to the job
594+
- name: Upload ODBC MSI to the job
660595
uses: actions/upload-artifact@v7
661596
with:
662597
name: flight-sql-odbc-msi-installer
@@ -745,40 +680,6 @@ jobs:
745680
remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
746681
remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
747682

748-
odbc-release:
749-
needs: odbc-msvc
750-
name: ODBC release
751-
runs-on: ubuntu-latest
752-
if: ${{ startsWith(github.ref_name, 'apache-arrow-') && contains(github.ref_name, '-rc') }}
753-
permissions:
754-
# Upload to GitHub Release
755-
contents: write
756-
steps:
757-
- name: Checkout Arrow
758-
uses: actions/checkout@v6
759-
with:
760-
persist-credentials: false
761-
fetch-depth: 0
762-
submodules: recursive
763-
- name: Download the artifacts
764-
uses: actions/download-artifact@v8
765-
with:
766-
name: flight-sql-odbc-msi-installer
767-
- name: Wait for creating GitHub Release
768-
env:
769-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
770-
run: |
771-
dev/release/utils-watch-gh-workflow.sh \
772-
${GITHUB_REF_NAME} \
773-
release_candidate.yml
774-
- name: Upload the artifacts to GitHub Release
775-
env:
776-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
777-
run: |
778-
gh release upload ${GITHUB_REF_NAME} \
779-
--clobber \
780-
Apache-Arrow-Flight-SQL-ODBC-*-win64.msi
781-
782683
report-extra-cpp:
783684
if: github.event_name == 'schedule' && always()
784685
needs:

0 commit comments

Comments
 (0)