From 0f3fefd2cbaf365ff2b4111b3b1744671166301b Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Wed, 22 Apr 2026 13:18:06 -0700 Subject: [PATCH 1/4] 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 --- .github/actions/odbc-windows/action.yml | 95 +++++++++ .github/workflows/cpp_extra.yml | 260 ++++++++++++++---------- 2 files changed, 245 insertions(+), 110 deletions(-) create mode 100644 .github/actions/odbc-windows/action.yml diff --git a/.github/actions/odbc-windows/action.yml b/.github/actions/odbc-windows/action.yml new file mode 100644 index 000000000000..10ba9ebbc15c --- /dev/null +++ b/.github/actions/odbc-windows/action.yml @@ -0,0 +1,95 @@ +# 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: ODBC Windows Reusable +inputs: + github-token: + description: 'GITHUB_TOKEN for vcpkg caching' + required: true +runs: + using: "composite" + steps: + - name: Disable Crash Dialogs + shell: pwsh + run: | + reg add ` + "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" ` + /v DontShowUI ` + /t REG_DWORD ` + /d 1 ` + /f + - name: Download Timezone Database + shell: bash + run: ci/scripts/download_tz_database.sh + - name: Install ccache + shell: bash + run: | + ci/scripts/install_ccache.sh 4.12.1 /usr + - name: Setup ccache + shell: bash + run: | + ci/scripts/ccache_setup.sh + - name: ccache info + id: ccache-info + shell: bash + run: | + echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT + - name: Cache ccache + uses: actions/cache@v5 + with: + path: ${{ steps.ccache-info.outputs.cache-dir }} + key: cpp-odbc-ccache-windows-x64-${{ hashFiles('cpp/**') }} + restore-keys: cpp-odbc-ccache-windows-x64- + - name: Checkout vcpkg + uses: actions/checkout@v6 + with: + fetch-depth: 0 + path: vcpkg + repository: microsoft/vcpkg + - name: Bootstrap vcpkg + shell: pwsh + run: | + vcpkg\bootstrap-vcpkg.bat + $VCPKG_ROOT = $(Resolve-Path -LiteralPath "vcpkg").ToString() + Write-Output ${VCPKG_ROOT} | ` + Out-File -FilePath ${Env:GITHUB_PATH} -Encoding utf8 -Append + Write-Output "VCPKG_ROOT=${VCPKG_ROOT}" | ` + Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append + - name: Setup NuGet credentials for vcpkg caching + shell: bash + run: | + $(vcpkg fetch nuget | tail -n 1) \ + sources add \ + -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" \ + -storepasswordincleartext \ + -name "GitHub" \ + -username "$GITHUB_REPOSITORY_OWNER" \ + -password "${{ inputs.github-token }}" + $(vcpkg fetch nuget | tail -n 1) \ + setapikey "${{ inputs.github-token }}" \ + -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" + - name: Build + shell: cmd + run: | + set VCPKG_ROOT_KEEP=%VCPKG_ROOT% + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + set VCPKG_ROOT=%VCPKG_ROOT_KEEP% + bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build" + - name: Register Flight SQL ODBC Driver + shell: cmd + run: | + call "cpp\src\arrow\flight\sql\odbc\tests\install_odbc.cmd" ${{ github.workspace }}\build\cpp\%ARROW_BUILD_TYPE%\arrow_flight_sql_odbc.dll diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 73b06f9deec5..b23a934a4338 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -73,6 +73,13 @@ on: schedule: - cron: | 0 0 * * * + workflow_dispatch: + inputs: + odbc_release_step: + description: 'ODBC MSI release step' + required: true + default: false + type: boolean concurrency: group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} @@ -95,9 +102,10 @@ jobs: name: ${{ matrix.title }} runs-on: ${{ matrix.runs-on }} if: >- + github.event_name != 'workflow_dispatch' && ( needs.check-labels.outputs.force == 'true' || contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || - contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') + contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')) timeout-minutes: 75 strategy: fail-fast: false @@ -184,9 +192,10 @@ jobs: msvc-arm64: needs: check-labels if: >- + github.event_name != 'workflow_dispatch' && ( needs.check-labels.outputs.force == 'true' || contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || - contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') + contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')) name: ARM64 Windows 11 MSVC uses: ./.github/workflows/cpp_windows.yml with: @@ -199,9 +208,10 @@ jobs: name: JNI ${{ matrix.platform.runs-on }} ${{ matrix.platform.arch }} runs-on: ${{ matrix.platform.runs-on }} if: >- + github.event_name != 'workflow_dispatch' && ( needs.check-labels.outputs.force == 'true' || contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || - contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') + contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')) timeout-minutes: 240 permissions: # This is for using GitHub Packages for vcpkg cache @@ -264,9 +274,10 @@ jobs: name: JNI macOS runs-on: macos-14 if: >- + github.event_name != 'workflow_dispatch' && ( needs.check-labels.outputs.force == 'true' || contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || - contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') + contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')) timeout-minutes: 45 env: MACOSX_DEPLOYMENT_TARGET: "14.0" @@ -410,9 +421,10 @@ jobs: name: ODBC ${{ matrix.build-type }} ${{ matrix.architecture }} macOS ${{ matrix.macos-version }} runs-on: macos-${{ matrix.macos-version }} if: >- + github.event_name != 'workflow_dispatch' && ( needs.check-labels.outputs.force == 'true' || contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || - contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') + contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')) timeout-minutes: 120 strategy: fail-fast: false @@ -536,13 +548,14 @@ jobs: name: ODBC Windows runs-on: windows-2022 if: >- + github.event_name != 'workflow_dispatch' && ( needs.check-labels.outputs.force == 'true' || contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') || - contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++') + contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')) timeout-minutes: 240 permissions: packages: write - env: + env: &odbc_msvc_env ARROW_BUILD_SHARED: ON ARROW_BUILD_STATIC: OFF ARROW_BUILD_TESTS: ON @@ -559,81 +572,16 @@ jobs: VCPKG_BINARY_SOURCES: 'clear;nugettimeout,600;nuget,GitHub,readwrite' VCPKG_DEFAULT_TRIPLET: x64-windows steps: - - name: Disable Crash Dialogs - run: | - reg add ` - "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" ` - /v DontShowUI ` - /t REG_DWORD ` - /d 1 ` - /f - name: Checkout Arrow uses: actions/checkout@v6 with: persist-credentials: false fetch-depth: 0 submodules: recursive - - name: Download Timezone Database - shell: bash - run: ci/scripts/download_tz_database.sh - - name: Install ccache - shell: bash - run: | - ci/scripts/install_ccache.sh 4.12.1 /usr - - name: Setup ccache - shell: bash - run: | - ci/scripts/ccache_setup.sh - - name: ccache info - id: ccache-info - shell: bash - run: | - echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT - - name: Cache ccache - uses: actions/cache@v5 - with: - path: ${{ steps.ccache-info.outputs.cache-dir }} - key: cpp-odbc-ccache-windows-x64-${{ hashFiles('cpp/**') }} - restore-keys: cpp-odbc-ccache-windows-x64- - - name: Checkout vcpkg - uses: actions/checkout@v6 + - name: Build ODBC Windows + uses: ./.github/actions/odbc-windows with: - persist-credentials: false - fetch-depth: 0 - path: vcpkg - repository: microsoft/vcpkg - - name: Bootstrap vcpkg - run: | - vcpkg\bootstrap-vcpkg.bat - $VCPKG_ROOT = $(Resolve-Path -LiteralPath "vcpkg").ToString() - Write-Output ${VCPKG_ROOT} | ` - Out-File -FilePath ${Env:GITHUB_PATH} -Encoding utf8 -Append - Write-Output "VCPKG_ROOT=${VCPKG_ROOT}" | ` - Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append - - name: Setup NuGet credentials for vcpkg caching - shell: bash - run: | - $(vcpkg fetch nuget | tail -n 1) \ - sources add \ - -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" \ - -storepasswordincleartext \ - -name "GitHub" \ - -username "$GITHUB_REPOSITORY_OWNER" \ - -password "${{ secrets.GITHUB_TOKEN }}" - $(vcpkg fetch nuget | tail -n 1) \ - setapikey "${{ secrets.GITHUB_TOKEN }}" \ - -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" - - name: Build - shell: cmd - run: | - set VCPKG_ROOT_KEEP=%VCPKG_ROOT% - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 - set VCPKG_ROOT=%VCPKG_ROOT_KEEP% - bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build" - - name: Register Flight SQL ODBC Driver - shell: cmd - run: | - call "cpp\src\arrow\flight\sql\odbc\tests\install_odbc.cmd" ${{ github.workspace }}\build\cpp\%ARROW_BUILD_TYPE%\arrow_flight_sql_odbc.dll + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Test shell: cmd run: | @@ -656,7 +604,7 @@ jobs: wix --version cd build/cpp cpack - - name: Upload the artifacts to the job + - name: Upload ODBC MSI to the job uses: actions/upload-artifact@v7 with: name: flight-sql-odbc-msi-installer @@ -698,6 +646,130 @@ jobs: Write-Error "ODBC DLL not found" exit 1 + odbc-msvc-upload-dll: + needs: check-labels + name: ODBC Windows Upload Unsigned DLL + runs-on: windows-2022 + if: >- + ${{ + startsWith(github.ref_name, 'apache-arrow-') && + contains(github.ref_name, '-rc') && + !inputs.odbc_release_step + }} + timeout-minutes: 240 + permissions: + packages: write + env: *odbc_msvc_env + steps: + - name: Checkout Arrow + uses: actions/checkout@v6 + with: + fetch-depth: 0 + submodules: recursive + - name: Build ODBC Windows + uses: ./.github/actions/odbc-windows + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Rename Unsigned ODBC DLL + run: | + Rename-Item ` + -Path build/cpp/${{ env.ARROW_BUILD_TYPE }}/arrow_flight_sql_odbc.dll ` + -NewName arrow_flight_sql_odbc_unsigned.dll + - name: Upload ODBC DLL to the job + uses: actions/upload-artifact@v7 + with: + name: flight-sql-odbc-dll + path: build/cpp/${{ env.ARROW_BUILD_TYPE }}/arrow_flight_sql_odbc_unsigned.dll + if-no-files-found: error + + odbc-dll-release: + needs: odbc-msvc-upload-dll + name: Upload Unsigned ODBC DLL + runs-on: ubuntu-latest + permissions: + # Upload to GitHub Release + contents: write + steps: + - name: Checkout Arrow + uses: actions/checkout@v6 + with: + fetch-depth: 0 + submodules: recursive + - name: Download the artifacts + uses: actions/download-artifact@v8 + with: + name: flight-sql-odbc-dll + - name: Wait for creating GitHub Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + dev/release/utils-watch-gh-workflow.sh \ + ${GITHUB_REF_NAME} \ + release_candidate.yml + - name: Upload the artifacts to GitHub Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload ${GITHUB_REF_NAME} \ + --clobber \ + arrow_flight_sql_odbc_unsigned.dll + + odbc-msvc-upload-msi: + needs: check-labels + name: ODBC Windows Build & Upload Unsigned MSI + runs-on: windows-2022 + if: inputs.odbc_release_step + timeout-minutes: 240 + permissions: + # Upload to GitHub Release + contents: write + packages: write + env: *odbc_msvc_env + steps: + - name: Checkout Arrow + uses: actions/checkout@v6 + with: + fetch-depth: 0 + submodules: recursive + - name: Download signed ODBC DLL + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release download $env:GITHUB_REF_NAME ` + --pattern arrow_flight_sql_odbc.dll ` + --clobber + - name: Build ODBC Windows + uses: ./.github/actions/odbc-windows + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Replace signed DLL with unsigned DLL + run: | + Move-Item ` + -Path ./arrow_flight_sql_odbc.dll ` + -Destination build/cpp/${{ env.ARROW_BUILD_TYPE }}/arrow_flight_sql_odbc.dll ` + -Force + - name: Install WiX Toolset + shell: pwsh + run: | + Invoke-WebRequest -Uri https://github.com/wixtoolset/wix/releases/download/v6.0.0/wix-cli-x64.msi -OutFile wix-cli-x64.msi + Start-Process -FilePath wix-cli-x64.msi -ArgumentList '/quiet', 'Include_freethreaded=1' -Wait + echo "C:\Program Files\WiX Toolset v6.0\bin\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + - name: Build MSI ODBC installer + shell: pwsh + run: | + # Verify WiX version + wix --version + cd build/cpp + cpack + - name: Upload the artifacts to GitHub Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cd build/cpp + gh release upload $env:GITHUB_REF_NAME ` + --clobber ` + Apache-Arrow-Flight-SQL-ODBC-*-win64.msi + odbc-nightly: needs: odbc-msvc name: ODBC nightly @@ -745,40 +817,6 @@ jobs: remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }} remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }} - odbc-release: - needs: odbc-msvc - name: ODBC release - runs-on: ubuntu-latest - if: ${{ startsWith(github.ref_name, 'apache-arrow-') && contains(github.ref_name, '-rc') }} - permissions: - # Upload to GitHub Release - contents: write - steps: - - name: Checkout Arrow - uses: actions/checkout@v6 - with: - persist-credentials: false - fetch-depth: 0 - submodules: recursive - - name: Download the artifacts - uses: actions/download-artifact@v8 - with: - name: flight-sql-odbc-msi-installer - - name: Wait for creating GitHub Release - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - dev/release/utils-watch-gh-workflow.sh \ - ${GITHUB_REF_NAME} \ - release_candidate.yml - - name: Upload the artifacts to GitHub Release - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release upload ${GITHUB_REF_NAME} \ - --clobber \ - Apache-Arrow-Flight-SQL-ODBC-*-win64.msi - report-extra-cpp: if: github.event_name == 'schedule' && always() needs: @@ -789,6 +827,8 @@ jobs: - odbc-linux - odbc-macos - odbc-msvc + - odbc-msvc-upload-dll + - odbc-msvc-upload-msi - odbc-nightly uses: ./.github/workflows/report_ci.yml secrets: From a227e2839a5236218ee5efb8c0787c85592a7b7e Mon Sep 17 00:00:00 2001 From: justing-bq <62349012+justing-bq@users.noreply.github.com> Date: Thu, 21 May 2026 12:18:43 -0700 Subject: [PATCH 2/4] Address feedback --- .github/actions/odbc-windows/action.yml | 1 + .github/workflows/cpp_extra.yml | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/actions/odbc-windows/action.yml b/.github/actions/odbc-windows/action.yml index 10ba9ebbc15c..153fccceefbe 100644 --- a/.github/actions/odbc-windows/action.yml +++ b/.github/actions/odbc-windows/action.yml @@ -57,6 +57,7 @@ runs: - name: Checkout vcpkg uses: actions/checkout@v6 with: + persist-credentials: false fetch-depth: 0 path: vcpkg repository: microsoft/vcpkg diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index b23a934a4338..502ca496dfd0 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -77,7 +77,7 @@ on: inputs: odbc_release_step: description: 'ODBC MSI release step' - required: true + required: false default: false type: boolean @@ -646,6 +646,8 @@ jobs: Write-Error "ODBC DLL not found" exit 1 + # GH-49537 CPack only packages from a single build directory, so the build + # cannot be reused and we need to rebuild the MSI in a separate workflow. odbc-msvc-upload-dll: needs: check-labels name: ODBC Windows Upload Unsigned DLL @@ -664,6 +666,7 @@ jobs: - name: Checkout Arrow uses: actions/checkout@v6 with: + persist-credentials: false fetch-depth: 0 submodules: recursive - name: Build ODBC Windows @@ -693,6 +696,7 @@ jobs: - name: Checkout Arrow uses: actions/checkout@v6 with: + persist-credentials: false fetch-depth: 0 submodules: recursive - name: Download the artifacts @@ -729,6 +733,7 @@ jobs: - name: Checkout Arrow uses: actions/checkout@v6 with: + persist-credentials: false fetch-depth: 0 submodules: recursive - name: Download signed ODBC DLL @@ -742,7 +747,7 @@ jobs: uses: ./.github/actions/odbc-windows with: github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Replace signed DLL with unsigned DLL + - name: Replace unsigned DLL with signed DLL run: | Move-Item ` -Path ./arrow_flight_sql_odbc.dll ` From f4165e9d398881c1a5cb08759d47b01fee90109c Mon Sep 17 00:00:00 2001 From: justing-bq <62349012+justing-bq@users.noreply.github.com> Date: Thu, 21 May 2026 15:02:25 -0700 Subject: [PATCH 3/4] Move workflows to package_odbc.yml --- .github/workflows/cpp_extra.yml | 136 ----------------- .github/workflows/package_odbc.yml | 197 +++++++++++++++++++++++++ dev/release/07-flightsqlodbc-upload.sh | 6 +- 3 files changed, 200 insertions(+), 139 deletions(-) create mode 100644 .github/workflows/package_odbc.yml diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 502ca496dfd0..5ad5c8036472 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -73,13 +73,6 @@ on: schedule: - cron: | 0 0 * * * - workflow_dispatch: - inputs: - odbc_release_step: - description: 'ODBC MSI release step' - required: false - default: false - type: boolean concurrency: group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} @@ -646,135 +639,6 @@ jobs: Write-Error "ODBC DLL not found" exit 1 - # GH-49537 CPack only packages from a single build directory, so the build - # cannot be reused and we need to rebuild the MSI in a separate workflow. - odbc-msvc-upload-dll: - needs: check-labels - name: ODBC Windows Upload Unsigned DLL - runs-on: windows-2022 - if: >- - ${{ - startsWith(github.ref_name, 'apache-arrow-') && - contains(github.ref_name, '-rc') && - !inputs.odbc_release_step - }} - timeout-minutes: 240 - permissions: - packages: write - env: *odbc_msvc_env - steps: - - name: Checkout Arrow - uses: actions/checkout@v6 - with: - persist-credentials: false - fetch-depth: 0 - submodules: recursive - - name: Build ODBC Windows - uses: ./.github/actions/odbc-windows - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Rename Unsigned ODBC DLL - run: | - Rename-Item ` - -Path build/cpp/${{ env.ARROW_BUILD_TYPE }}/arrow_flight_sql_odbc.dll ` - -NewName arrow_flight_sql_odbc_unsigned.dll - - name: Upload ODBC DLL to the job - uses: actions/upload-artifact@v7 - with: - name: flight-sql-odbc-dll - path: build/cpp/${{ env.ARROW_BUILD_TYPE }}/arrow_flight_sql_odbc_unsigned.dll - if-no-files-found: error - - odbc-dll-release: - needs: odbc-msvc-upload-dll - name: Upload Unsigned ODBC DLL - runs-on: ubuntu-latest - permissions: - # Upload to GitHub Release - contents: write - steps: - - name: Checkout Arrow - uses: actions/checkout@v6 - with: - persist-credentials: false - fetch-depth: 0 - submodules: recursive - - name: Download the artifacts - uses: actions/download-artifact@v8 - with: - name: flight-sql-odbc-dll - - name: Wait for creating GitHub Release - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - dev/release/utils-watch-gh-workflow.sh \ - ${GITHUB_REF_NAME} \ - release_candidate.yml - - name: Upload the artifacts to GitHub Release - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release upload ${GITHUB_REF_NAME} \ - --clobber \ - arrow_flight_sql_odbc_unsigned.dll - - odbc-msvc-upload-msi: - needs: check-labels - name: ODBC Windows Build & Upload Unsigned MSI - runs-on: windows-2022 - if: inputs.odbc_release_step - timeout-minutes: 240 - permissions: - # Upload to GitHub Release - contents: write - packages: write - env: *odbc_msvc_env - steps: - - name: Checkout Arrow - uses: actions/checkout@v6 - with: - persist-credentials: false - fetch-depth: 0 - submodules: recursive - - name: Download signed ODBC DLL - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release download $env:GITHUB_REF_NAME ` - --pattern arrow_flight_sql_odbc.dll ` - --clobber - - name: Build ODBC Windows - uses: ./.github/actions/odbc-windows - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Replace unsigned DLL with signed DLL - run: | - Move-Item ` - -Path ./arrow_flight_sql_odbc.dll ` - -Destination build/cpp/${{ env.ARROW_BUILD_TYPE }}/arrow_flight_sql_odbc.dll ` - -Force - - name: Install WiX Toolset - shell: pwsh - run: | - Invoke-WebRequest -Uri https://github.com/wixtoolset/wix/releases/download/v6.0.0/wix-cli-x64.msi -OutFile wix-cli-x64.msi - Start-Process -FilePath wix-cli-x64.msi -ArgumentList '/quiet', 'Include_freethreaded=1' -Wait - echo "C:\Program Files\WiX Toolset v6.0\bin\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - name: Build MSI ODBC installer - shell: pwsh - run: | - # Verify WiX version - wix --version - cd build/cpp - cpack - - name: Upload the artifacts to GitHub Release - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - cd build/cpp - gh release upload $env:GITHUB_REF_NAME ` - --clobber ` - Apache-Arrow-Flight-SQL-ODBC-*-win64.msi - odbc-nightly: needs: odbc-msvc name: ODBC nightly diff --git a/.github/workflows/package_odbc.yml b/.github/workflows/package_odbc.yml new file mode 100644 index 000000000000..52cd18942cf0 --- /dev/null +++ b/.github/workflows/package_odbc.yml @@ -0,0 +1,197 @@ +# 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: Package ODBC + +on: + push: + branches: + - '**' + - '!dependabot/**' + paths: + - '.github/actions/odbc-windows/action.yml' + - '.github/workflows/check_labels.yml' + - '.github/workflows/cpp_extra.yml' + - '.github/workflows/report_ci.yml' + - 'ci/scripts/ccache_setup.sh' + - 'ci/scripts/cpp_*' + - 'ci/scripts/download_tz_database.sh' + - 'ci/scripts/install_ccache.sh' + - 'cpp/**' + - 'format/Flight.proto' + - 'testing' + tags: + - "apache-arrow-*-rc*" + workflow_dispatch: + inputs: + odbc_release_step: + description: 'ODBC MSI release step' + required: false + default: false + type: boolean + +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + +permissions: + actions: read + contents: read + pull-requests: read + +jobs: + # GH-49537 CPack only packages from a single build directory, so the build + # cannot be reused and we need to rebuild the MSI in a separate workflow. + odbc-msvc-upload-dll: + name: ODBC Windows Upload Unsigned DLL + runs-on: windows-2022 + if: >- + ${{ + startsWith(github.ref_name, 'apache-arrow-') && + contains(github.ref_name, '-rc') && + !inputs.odbc_release_step + }} + timeout-minutes: 240 + permissions: + packages: write + env: &odbc_msvc_env + ARROW_BUILD_SHARED: ON + ARROW_BUILD_STATIC: OFF + ARROW_BUILD_TESTS: OFF + ARROW_BUILD_TYPE: release + # Turn Arrow CSV off to disable `find_package(Arrow)` check on MSVC CI. + # GH-49050 TODO: enable `find_package(Arrow)` check on MSVC CI. + ARROW_CSV: OFF + ARROW_DEPENDENCY_SOURCE: VCPKG + ARROW_FLIGHT_SQL_ODBC: ON + ARROW_FLIGHT_SQL_ODBC_INSTALLER: ON + ARROW_HOME: /usr + CMAKE_GENERATOR: Ninja + CMAKE_INSTALL_PREFIX: /usr + VCPKG_BINARY_SOURCES: 'clear;nugettimeout,600;nuget,GitHub,readwrite' + VCPKG_DEFAULT_TRIPLET: x64-windows + steps: + - name: Checkout Arrow + uses: actions/checkout@v6 + with: + persist-credentials: false + fetch-depth: 0 + submodules: recursive + - name: Build ODBC Windows + uses: ./.github/actions/odbc-windows + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Rename Unsigned ODBC DLL + run: | + Rename-Item ` + -Path build/cpp/${{ env.ARROW_BUILD_TYPE }}/arrow_flight_sql_odbc.dll ` + -NewName arrow_flight_sql_odbc_unsigned.dll + - name: Upload ODBC DLL to the job + uses: actions/upload-artifact@v7 + with: + name: flight-sql-odbc-dll + path: build/cpp/${{ env.ARROW_BUILD_TYPE }}/arrow_flight_sql_odbc_unsigned.dll + if-no-files-found: error + + odbc-dll-release: + needs: odbc-msvc-upload-dll + name: Upload Unsigned ODBC DLL + runs-on: ubuntu-latest + permissions: + # Upload to GitHub Release + contents: write + steps: + - name: Checkout Arrow + uses: actions/checkout@v6 + with: + persist-credentials: false + fetch-depth: 0 + submodules: recursive + - name: Download the artifacts + uses: actions/download-artifact@v8 + with: + name: flight-sql-odbc-dll + - name: Wait for creating GitHub Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + dev/release/utils-watch-gh-workflow.sh \ + ${GITHUB_REF_NAME} \ + release_candidate.yml + - name: Upload the artifacts to GitHub Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload ${GITHUB_REF_NAME} \ + --clobber \ + arrow_flight_sql_odbc_unsigned.dll + + odbc-msvc-upload-msi: + name: ODBC Windows Build & Upload Unsigned MSI + runs-on: windows-2022 + if: inputs.odbc_release_step + timeout-minutes: 240 + permissions: + # Upload to GitHub Release + contents: write + packages: write + env: *odbc_msvc_env + steps: + - name: Checkout Arrow + uses: actions/checkout@v6 + with: + persist-credentials: false + fetch-depth: 0 + submodules: recursive + - name: Download signed ODBC DLL + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release download $env:GITHUB_REF_NAME ` + --pattern arrow_flight_sql_odbc.dll ` + --clobber + - name: Build ODBC Windows + uses: ./.github/actions/odbc-windows + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Replace unsigned DLL with signed DLL + run: | + Move-Item ` + -Path ./arrow_flight_sql_odbc.dll ` + -Destination build/cpp/${{ env.ARROW_BUILD_TYPE }}/arrow_flight_sql_odbc.dll ` + -Force + - name: Install WiX Toolset + shell: pwsh + run: | + Invoke-WebRequest -Uri https://github.com/wixtoolset/wix/releases/download/v6.0.0/wix-cli-x64.msi -OutFile wix-cli-x64.msi + Start-Process -FilePath wix-cli-x64.msi -ArgumentList '/quiet', 'Include_freethreaded=1' -Wait + echo "C:\Program Files\WiX Toolset v6.0\bin\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + - name: Build MSI ODBC installer + shell: pwsh + run: | + # Verify WiX version + wix --version + cd build/cpp + cpack + - name: Upload the artifacts to GitHub Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cd build/cpp + gh release upload $env:GITHUB_REF_NAME ` + --clobber ` + Apache-Arrow-Flight-SQL-ODBC-*-win64.msi diff --git a/dev/release/07-flightsqlodbc-upload.sh b/dev/release/07-flightsqlodbc-upload.sh index c47b5076f9c0..3c1778604606 100755 --- a/dev/release/07-flightsqlodbc-upload.sh +++ b/dev/release/07-flightsqlodbc-upload.sh @@ -136,15 +136,15 @@ if [ "${PHASE_SIGN_DLL}" -gt 0 ]; then fi if [ "${PHASE_BUILD_MSI}" -gt 0 ]; then - echo "[4/8 Triggering odbc_release_step in cpp_extra.yml workflow..." - gh workflow run cpp_extra.yml \ + echo "[4/8 Triggering odbc_release_step in package_odbc.yml workflow..." + gh workflow run package_odbc.yml \ --repo "${GITHUB_REPOSITORY}" \ --ref "${tag}" \ --field odbc_release_step=true echo "[5/8 Waiting for workflow to complete. This can take a very long time..." REPOSITORY="${GITHUB_REPOSITORY}" \ - "${SOURCE_DIR}/utils-watch-gh-workflow.sh" "${tag}" cpp_extra.yml + "${SOURCE_DIR}/utils-watch-gh-workflow.sh" "${tag}" package_odbc.yml fi if [ "${PHASE_SIGN_MSI}" -gt 0 ]; then From 9086614119bdcf64d3f93ed7a24bc353fe338076 Mon Sep 17 00:00:00 2001 From: justing-bq <62349012+justing-bq@users.noreply.github.com> Date: Fri, 22 May 2026 12:50:06 -0700 Subject: [PATCH 4/4] Address review feedback --- .github/workflows/cpp_extra.yml | 2 -- .github/workflows/package_odbc.yml | 1 + dev/release/07-flightsqlodbc-upload.sh | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 5ad5c8036472..fd15809799c1 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -696,8 +696,6 @@ jobs: - odbc-linux - odbc-macos - odbc-msvc - - odbc-msvc-upload-dll - - odbc-msvc-upload-msi - odbc-nightly uses: ./.github/workflows/report_ci.yml secrets: diff --git a/.github/workflows/package_odbc.yml b/.github/workflows/package_odbc.yml index 52cd18942cf0..a3373da251d1 100644 --- a/.github/workflows/package_odbc.yml +++ b/.github/workflows/package_odbc.yml @@ -26,6 +26,7 @@ on: - '.github/actions/odbc-windows/action.yml' - '.github/workflows/check_labels.yml' - '.github/workflows/cpp_extra.yml' + - '.github/workflows/package_odbc.yml' - '.github/workflows/report_ci.yml' - 'ci/scripts/ccache_setup.sh' - 'ci/scripts/cpp_*' diff --git a/dev/release/07-flightsqlodbc-upload.sh b/dev/release/07-flightsqlodbc-upload.sh index 3c1778604606..eec8bb964629 100755 --- a/dev/release/07-flightsqlodbc-upload.sh +++ b/dev/release/07-flightsqlodbc-upload.sh @@ -136,7 +136,7 @@ if [ "${PHASE_SIGN_DLL}" -gt 0 ]; then fi if [ "${PHASE_BUILD_MSI}" -gt 0 ]; then - echo "[4/8 Triggering odbc_release_step in package_odbc.yml workflow..." + echo "[4/8] Triggering odbc_release_step in package_odbc.yml workflow..." gh workflow run package_odbc.yml \ --repo "${GITHUB_REPOSITORY}" \ --ref "${tag}" \