diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 8d7390dd528..b38ccaa2779 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -530,8 +530,43 @@ jobs: uses: actions/upload-artifact@v6 with: name: flight-sql-odbc-msi-installer - path: build/cpp/Apache Arrow Flight SQL ODBC-*-win64.msi + path: build/cpp/Apache-Arrow-Flight-SQL-ODBC-*-win64.msi if-no-files-found: error + - name: Install ODBC MSI + run: | + cd build/cpp + $odbc_msi = Get-ChildItem -Filter "Apache-Arrow-Flight-SQL-ODBC-*-win64.msi" + if (-not $odbc_msi) { + Write-Error "ODBC MSI not found" + exit 1 + } + + foreach ($msi in $odbc_msi) { + Write-Host "Installing $($msi.Name) with logs" + $log = "odbc-install.log" + Start-Process msiexec.exe -Wait -ArgumentList "/i `"$msi`"", "/qn", "/L*V `"$log`"" + Get-Content $log + } + - name: Check ODBC DLL installation + run: | + $dirs = Get-ChildItem "C:\Program Files" -Directory -Filter "Apache-Arrow-Flight-SQL-ODBC*" + + foreach ($dir in $dirs) { + $bin = Join-Path $dir.FullName "bin" + + if (Test-Path $bin) { + tree $bin /f + + $dll = Join-Path $bin "arrow_flight_sql_odbc.dll" + if (Test-Path $dll) { + Write-Host "Found ODBC DLL: $dll" + exit 0 + } + } + } + + Write-Error "ODBC DLL not found" + exit 1 odbc-nightly: needs: odbc-msvc @@ -579,6 +614,39 @@ 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: + fetch-depth: 0 + submodules: recursive + - name: Download the artifacts + uses: actions/download-artifact@v7 + 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: diff --git a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt index c18a8e5de95..39040c45024 100644 --- a/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt +++ b/cpp/src/arrow/flight/sql/odbc/CMakeLists.txt @@ -106,6 +106,8 @@ if(ARROW_FLIGHT_SQL_ODBC_INSTALLER) set(CPACK_PACKAGE_VERSION_PATCH ${ODBC_PACKAGE_VERSION_PATCH}) set(CPACK_PACKAGE_NAME ${ODBC_PACKAGE_NAME}) + # Make sure the MSI name contains only hyphens, not spaces + string(REPLACE " " "-" CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") set(CPACK_PACKAGE_VENDOR ${ODBC_PACKAGE_VENDOR}) set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Apache Arrow Flight SQL ODBC Driver") set(CPACK_PACKAGE_CONTACT "dev@arrow.apache.org") diff --git a/cpp/src/arrow/flight/sql/odbc/README.md b/cpp/src/arrow/flight/sql/odbc/README.md index 8c2d9705a1d..a8f3bc727f7 100644 --- a/cpp/src/arrow/flight/sql/odbc/README.md +++ b/cpp/src/arrow/flight/sql/odbc/README.md @@ -47,7 +47,7 @@ should show as an available ODBC driver in the x64 ODBC Driver Manager. 3. `cd` to `build` folder. 4. Run `cpack`. -If the generation is successful, you will find `Apache Arrow Flight SQL ODBC--win64.msi` generated under the `build` folder. +If the generation is successful, you will find `Apache-Arrow-Flight-SQL-ODBC--win64.msi` generated under the `build` folder. ## Steps to Enable Logging diff --git a/dev/release/04-binary-download.sh b/dev/release/04-binary-download.sh index 68e1664b599..210a9406c2d 100755 --- a/dev/release/04-binary-download.sh +++ b/dev/release/04-binary-download.sh @@ -46,7 +46,7 @@ tag="apache-arrow-${version_with_rc}" archery crossbow download-artifacts --no-fetch ${CROSSBOW_JOB_ID} "$@" -# Download Linux packages. +# Download Linux packages and ODBC MSI. gh release download "${tag}" \ --dir "packages/${CROSSBOW_JOB_ID}" \ --pattern "almalinux-*.tar.gz" \ @@ -54,5 +54,6 @@ gh release download "${tag}" \ --pattern "centos-*.tar.gz" \ --pattern "debian-*.tar.gz" \ --pattern "ubuntu-*.tar.gz" \ + --pattern "Apache-Arrow-Flight-SQL-ODBC-*-win64.msi" \ --repo "${REPOSITORY:-apache/arrow}" \ --skip-existing diff --git a/dev/release/05-binary-upload.sh b/dev/release/05-binary-upload.sh index f628cce0e0b..45793dd6ec5 100755 --- a/dev/release/05-binary-upload.sh +++ b/dev/release/05-binary-upload.sh @@ -67,6 +67,7 @@ cd "${SOURCE_DIR}" : "${UPLOAD_CENTOS:=${UPLOAD_DEFAULT}}" : "${UPLOAD_DEBIAN:=${UPLOAD_DEFAULT}}" : "${UPLOAD_DOCS:=${UPLOAD_DEFAULT}}" +: "${UPLOAD_ODBC:=${UPLOAD_DEFAULT}}" : "${UPLOAD_PYTHON:=${UPLOAD_DEFAULT}}" : "${UPLOAD_R:=${UPLOAD_DEFAULT}}" : "${UPLOAD_UBUNTU:=${UPLOAD_DEFAULT}}" @@ -108,6 +109,10 @@ upload_to_github_release() { if [ "${UPLOAD_DOCS}" -gt 0 ]; then upload_to_github_release docs "${ARROW_ARTIFACTS_DIR}"/*-docs/* fi +if [ "${UPLOAD_ODBC}" -gt 0 ]; then + upload_to_github_release odbc \ + "${ARROW_ARTIFACTS_DIR}"/Apache-Arrow-Flight-SQL-ODBC-*-win64.msi +fi if [ "${UPLOAD_PYTHON}" -gt 0 ]; then upload_to_github_release python \ "${ARROW_ARTIFACTS_DIR}"/{python-sdist,wheel-*}/*