davsclaus commented on code in PR #24665: URL: https://github.com/apache/camel/pull/24665#discussion_r3573547428
########## .github/workflows/camel-launcher-windows.yml: ########## @@ -0,0 +1,128 @@ +# +# 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: Camel launcher Windows build + +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + detect-changes: + runs-on: ubuntu-latest + outputs: + camel-exe: ${{ steps.changes.outputs.camel-exe }} + camel-launcher: ${{ steps.changes.outputs.camel-launcher }} + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + # 50 commits covers any reasonable push batch; PRs fetch the base ref below. + fetch-depth: 50 + - id: changes + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "camel-exe=true" >> "$GITHUB_OUTPUT" + echo "camel-launcher=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + + if [ "${{ github.event_name }}" = "pull_request" ]; then + git fetch origin "${{ github.base_ref }}" --depth=1 + CHANGED="$(git diff --name-only "origin/${{ github.base_ref }}"...HEAD)" + else + CHANGED="$(git diff --name-only "${{ github.event.before }}" "${{ github.sha }}")" + fi + + echo "Changed files:" + echo "$CHANGED" + + camel_exe=false + camel_launcher=false + + if echo "$CHANGED" | grep -qE '^(tooling/camel-exe/|\.github/workflows/camel-launcher-windows\.yml)'; then + camel_exe=true + fi + + if echo "$CHANGED" | grep -qE '^(dsl/camel-jbang/camel-launcher/|tooling/camel-exe/|\.github/workflows/camel-launcher-windows\.yml)'; then + camel_launcher=true + fi + + echo "camel-exe=$camel_exe" >> "$GITHUB_OUTPUT" + echo "camel-launcher=$camel_launcher" >> "$GITHUB_OUTPUT" + + camel-exe: + needs: detect-changes + if: github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.camel-exe == 'true' + runs-on: windows-2022 + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + - name: Set up JDK 21 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 + with: + distribution: 'temurin' + java-version: '21' + cache: 'maven' + - name: Build and test native camel.exe + shell: cmd + run: | + for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VSINSTALL=%%i" + call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" + mvn -B -ntp -pl buildingtools install -DskipTests + mvn -B -ntp -pl tooling/camel-exe verify -Dcamel.exe.requireWindowsExe=true + + camel-launcher-windows: + needs: detect-changes + if: github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.camel-launcher == 'true' + runs-on: windows-2022 + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + - name: Set up JDK 21 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 + with: + distribution: 'temurin' + java-version: '21' + cache: 'maven' + - name: Build launcher with native camel.exe + shell: cmd + run: | + for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VSINSTALL=%%i" + call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" + mvn -B -ntp -pl buildingtools,tooling/camel-exe,dsl/camel-jbang/camel-launcher -am install -DskipTests -Dcamel.launcher.requireWindowsExe=true + - name: Assert archive carries bin/camel.exe + shell: pwsh + run: | + $zip = Get-ChildItem dsl/camel-jbang/camel-launcher/target/camel-launcher-*-bin.zip | Select-Object -First 1 + Add-Type -AssemblyName System.IO.Compression.FileSystem + $names = [System.IO.Compression.ZipFile]::OpenRead($zip.FullName).Entries.FullName + if ($names -notcontains 'bin/camel.exe') { throw 'camel.exe missing from launcher archive' } Review Comment: This assertion is currently failing in CI — the ZIP is produced but `bin/camel.exe` is not inside it. The `camel-exe` job passes (native build is fine), so the issue is in how the launcher integrates the artifact. Worth checking whether the `maven-dependency-plugin:copy` execution at `generate-resources` phase in `camel-launcher/pom.xml` actually runs before the assembly plugin, and whether the `include-camel-exe` profile activates correctly on the CI Windows runner. -- 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]
