alinaliBQ commented on code in PR #49603:
URL: https://github.com/apache/arrow/pull/49603#discussion_r3283279140


##########
.github/workflows/cpp_extra.yml:
##########
@@ -698,6 +646,130 @@ jobs:
           Write-Error "ODBC DLL not found"
           exit 1
 
+  odbc-msvc-upload-dll:

Review Comment:
   To address: 
https://github.com/apache/arrow/pull/49603/#discussion_r3270786944 comment
   
   ```suggestion
            exit 1
   
   # GH-49537 CPack only packages from a single build directory, so the build 
cannot be reused and we need to rebuild MSI in separate workflow.
   
     odbc-msvc-upload-dll:
   ```
   @justing-bq feel free to reword my draft comment.



##########
.github/workflows/cpp_extra.yml:
##########
@@ -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

Review Comment:
   ```suggestion
           with:
             fetch-depth: 0
             persist-credentials: false
             submodules: recursive
   ```
   
   To address this copilot comment: 
https://github.com/apache/arrow/pull/49603/changes#r3270750087



##########
.github/workflows/cpp_extra.yml:
##########
@@ -684,6 +632,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 

Review Comment:
   `inputs.odbc_release_step` is intended to run on `push`, not on 
`'workflow_dispatch'`



##########
.github/workflows/cpp_extra.yml:
##########
@@ -684,6 +632,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

Review Comment:
   `odbc-msvc-upload-msi` should only be manually triggered by 
`odbc_release_step`. As long as there is a signed DLL, the workflow should 
succeed 



##########
.github/workflows/cpp_extra.yml:
##########
@@ -684,6 +632,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 
+      }}

Review Comment:
   Since `apache-arrow-*-rc*` is accepted, `apache-arrow-test-` is allowed. 
Release step documentation is correct. 



##########
.github/workflows/cpp_extra.yml:
##########
@@ -684,6 +632,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

Review Comment:
   @justing-bq Please help with the renaming to `Replace unsigned DLL with 
signed DLL`



##########
.github/workflows/cpp_extra.yml:
##########
@@ -684,6 +632,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

Review Comment:
   I kept the logic separate since `odbc-msvc` runs Arrow ODBC tests. I see 
other Github upload workflows like `package_linux.yml` don't run Arrow tests, 
so I followed that pattern. 



##########
.github/workflows/cpp_extra.yml:
##########
@@ -684,6 +632,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

Review Comment:
   Yes I think this is a good idea. cc @justing-bq we can look into this. 



##########
.github/workflows/cpp_extra.yml:
##########
@@ -684,6 +632,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

Review Comment:
   I think `odbc-dll-release` can stay as a separate Ubuntu job since 
`dev/release/utils-watch-gh-workflow.sh` only runs on `ubuntu-latest`. Before I 
tried running `dev/release/utils-watch-gh-workflow.sh` on `windows-2022` and it 
didn't work. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to