apupier commented on code in PR #25030: URL: https://github.com/apache/camel/pull/25030#discussion_r3630994998
########## .github/workflows/package-native-validation.yml: ########## @@ -0,0 +1,155 @@ +# +# 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-native validation + +on: + push: + branches: + - main + paths: + - 'dsl/camel-jbang/camel-launcher/**' + - 'tooling/camel-exe/**' + - '.github/workflows/package-native-validation.yml' + pull_request: + branches: + - main + paths: + - 'dsl/camel-jbang/camel-launcher/**' + - 'tooling/camel-exe/**' + - '.github/workflows/package-native-validation.yml' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + # ── macOS / Linux (POSIX validators) ────────────────────────────── + posix-validator: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, ubuntu-latest] + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + # ubuntu-latest ships Homebrew (Linuxbrew) preinstalled but not on PATH (confirmed + # via actions/runner-images' Ubuntu readme: "Homebrew is preinstalled on image but + # not added to PATH", installed under /home/linuxbrew). Without this, `command -v + # brew` in camel-validate.sh's host-gate fails on Linux and the Homebrew validator + # silently SKIPs there, leaving macos-latest as the only leg that actually exercises + # it. macos-latest already has Homebrew on PATH by default, so this step is a no-op + # there. + - name: Add Linuxbrew to PATH (preinstalled but not on PATH on ubuntu-latest) + if: runner.os == 'Linux' + shell: bash + run: | + { + echo "/home/linuxbrew/.linuxbrew/bin" + echo "/home/linuxbrew/.linuxbrew/sbin" + } >> "$GITHUB_PATH" + { + echo "HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew" + echo "HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar" + echo "HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew/Homebrew" + } >> "$GITHUB_ENV" + + - name: Set up JDK 21 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 Review Comment: 5.6.0 is available https://github.com/actions/setup-java/releases/tag/v5.6.0 ########## .github/workflows/package-native-validation.yml: ########## @@ -0,0 +1,155 @@ +# +# 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-native validation + +on: + push: + branches: + - main + paths: + - 'dsl/camel-jbang/camel-launcher/**' + - 'tooling/camel-exe/**' + - '.github/workflows/package-native-validation.yml' + pull_request: + branches: + - main + paths: + - 'dsl/camel-jbang/camel-launcher/**' + - 'tooling/camel-exe/**' + - '.github/workflows/package-native-validation.yml' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + # ── macOS / Linux (POSIX validators) ────────────────────────────── + posix-validator: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, ubuntu-latest] + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + # ubuntu-latest ships Homebrew (Linuxbrew) preinstalled but not on PATH (confirmed + # via actions/runner-images' Ubuntu readme: "Homebrew is preinstalled on image but + # not added to PATH", installed under /home/linuxbrew). Without this, `command -v + # brew` in camel-validate.sh's host-gate fails on Linux and the Homebrew validator + # silently SKIPs there, leaving macos-latest as the only leg that actually exercises + # it. macos-latest already has Homebrew on PATH by default, so this step is a no-op + # there. + - name: Add Linuxbrew to PATH (preinstalled but not on PATH on ubuntu-latest) + if: runner.os == 'Linux' + shell: bash + run: | + { + echo "/home/linuxbrew/.linuxbrew/bin" + echo "/home/linuxbrew/.linuxbrew/sbin" + } >> "$GITHUB_PATH" + { + echo "HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew" + echo "HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar" + echo "HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew/Homebrew" + } >> "$GITHUB_ENV" + + - name: Set up JDK 21 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 + with: + distribution: 'temurin' + java-version: '21' + cache: 'maven' + + - name: Build camel-launcher distribution + shell: bash + run: | + mvn -B -ntp -pl buildingtools,dsl/camel-jbang/camel-launcher -am install -DskipTests + + - name: Stage a synthetic release version for offline validation + shell: bash + run: | + cd dsl/camel-jbang/camel-launcher + REAL_VERSION=$(mvn -q -B -ntp org.apache.maven.plugins:maven-help-plugin:3.5.1:evaluate \ + -Dexpression=project.version -DforceStdout) + TEST_VERSION="${REAL_VERSION%-SNAPSHOT}" + echo "TEST_VERSION=$TEST_VERSION" >> "$GITHUB_ENV" + cp -p "target/camel-launcher-$REAL_VERSION-bin.tar.gz" "target/camel-launcher-$TEST_VERSION-bin.tar.gz" + cp -p "target/camel-launcher-$REAL_VERSION-bin.zip" "target/camel-launcher-$TEST_VERSION-bin.zip" + # camel-package.sh prepare requires a WinGet release ZIP (camel-launcher-<v>-winget-bin.zip), but + # that artifact is only built by the -Dcamel.exe.build=true profile (native camel-exe), which this + # validation build does not run. The POSIX validators never consume the WinGet payload, so stage + # the already-built bin.zip under the WinGet name as an offline stand-in. Two names are needed: + # camel-package.sh's own existence check and cmp look for the stripped TEST_VERSION name (and + # CAMEL_PACKAGE_TEST_WINGET_REMOTE below points at the same bytes so the cmp passes without a + # network fetch to archive.apache.org), while JReleaser resolves the artifact from the real + # -SNAPSHOT POM version, so it needs the REAL_VERSION name too. + cp -p "target/camel-launcher-$REAL_VERSION-bin.zip" "target/camel-launcher-$TEST_VERSION-winget-bin.zip" + cp -p "target/camel-launcher-$REAL_VERSION-bin.zip" "target/camel-launcher-$REAL_VERSION-winget-bin.zip" + + - name: Prepare packages (stable, offline, synthetic release version) + shell: bash + run: | + cd dsl/camel-jbang/camel-launcher + CAMEL_PACKAGE_TEST_MODE=true CAMEL_PACKAGE_TEST_VERSION="$TEST_VERSION" \ + CAMEL_PACKAGE_TEST_WINGET_REMOTE="target/camel-launcher-$TEST_VERSION-winget-bin.zip" \ + sh src/jreleaser/bin/camel-package.sh prepare --channel stable + + - name: Validate local archive + Homebrew + SDKMAN (host-gated) + shell: bash + run: | + cd dsl/camel-jbang/camel-launcher + CAMEL_PACKAGE_TEST_MODE=true CAMEL_PACKAGE_TEST_VERSION="$TEST_VERSION" \ + bash src/jreleaser/bin/camel-validate.sh all + + - name: Run POSIX validator unit tests + shell: bash + run: | + cd dsl/camel-jbang/camel-launcher + mvn -B -ntp test -pl . -Dtest=PackageNativeValidationTest + + # ── Windows (install.ps1 unit tests) ────────────────────────────── + windows-validator: + runs-on: windows-latest + 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 Review Comment: 5.6.0 is available ########## .github/workflows/package-native-validation.yml: ########## @@ -0,0 +1,155 @@ +# +# 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-native validation + +on: + push: + branches: + - main + paths: + - 'dsl/camel-jbang/camel-launcher/**' + - 'tooling/camel-exe/**' + - '.github/workflows/package-native-validation.yml' + pull_request: + branches: + - main + paths: + - 'dsl/camel-jbang/camel-launcher/**' + - 'tooling/camel-exe/**' + - '.github/workflows/package-native-validation.yml' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + # ── macOS / Linux (POSIX validators) ────────────────────────────── + posix-validator: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, ubuntu-latest] + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + # ubuntu-latest ships Homebrew (Linuxbrew) preinstalled but not on PATH (confirmed + # via actions/runner-images' Ubuntu readme: "Homebrew is preinstalled on image but + # not added to PATH", installed under /home/linuxbrew). Without this, `command -v + # brew` in camel-validate.sh's host-gate fails on Linux and the Homebrew validator + # silently SKIPs there, leaving macos-latest as the only leg that actually exercises + # it. macos-latest already has Homebrew on PATH by default, so this step is a no-op + # there. + - name: Add Linuxbrew to PATH (preinstalled but not on PATH on ubuntu-latest) + if: runner.os == 'Linux' + shell: bash + run: | + { + echo "/home/linuxbrew/.linuxbrew/bin" + echo "/home/linuxbrew/.linuxbrew/sbin" + } >> "$GITHUB_PATH" + { + echo "HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew" + echo "HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar" + echo "HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew/Homebrew" + } >> "$GITHUB_ENV" + + - name: Set up JDK 21 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 + with: + distribution: 'temurin' + java-version: '21' + cache: 'maven' + + - name: Build camel-launcher distribution + shell: bash + run: | + mvn -B -ntp -pl buildingtools,dsl/camel-jbang/camel-launcher -am install -DskipTests + + - name: Stage a synthetic release version for offline validation + shell: bash + run: | + cd dsl/camel-jbang/camel-launcher + REAL_VERSION=$(mvn -q -B -ntp org.apache.maven.plugins:maven-help-plugin:3.5.1:evaluate \ + -Dexpression=project.version -DforceStdout) + TEST_VERSION="${REAL_VERSION%-SNAPSHOT}" + echo "TEST_VERSION=$TEST_VERSION" >> "$GITHUB_ENV" + cp -p "target/camel-launcher-$REAL_VERSION-bin.tar.gz" "target/camel-launcher-$TEST_VERSION-bin.tar.gz" + cp -p "target/camel-launcher-$REAL_VERSION-bin.zip" "target/camel-launcher-$TEST_VERSION-bin.zip" + # camel-package.sh prepare requires a WinGet release ZIP (camel-launcher-<v>-winget-bin.zip), but + # that artifact is only built by the -Dcamel.exe.build=true profile (native camel-exe), which this + # validation build does not run. The POSIX validators never consume the WinGet payload, so stage + # the already-built bin.zip under the WinGet name as an offline stand-in. Two names are needed: + # camel-package.sh's own existence check and cmp look for the stripped TEST_VERSION name (and + # CAMEL_PACKAGE_TEST_WINGET_REMOTE below points at the same bytes so the cmp passes without a + # network fetch to archive.apache.org), while JReleaser resolves the artifact from the real + # -SNAPSHOT POM version, so it needs the REAL_VERSION name too. + cp -p "target/camel-launcher-$REAL_VERSION-bin.zip" "target/camel-launcher-$TEST_VERSION-winget-bin.zip" + cp -p "target/camel-launcher-$REAL_VERSION-bin.zip" "target/camel-launcher-$REAL_VERSION-winget-bin.zip" + + - name: Prepare packages (stable, offline, synthetic release version) + shell: bash + run: | + cd dsl/camel-jbang/camel-launcher + CAMEL_PACKAGE_TEST_MODE=true CAMEL_PACKAGE_TEST_VERSION="$TEST_VERSION" \ + CAMEL_PACKAGE_TEST_WINGET_REMOTE="target/camel-launcher-$TEST_VERSION-winget-bin.zip" \ + sh src/jreleaser/bin/camel-package.sh prepare --channel stable + + - name: Validate local archive + Homebrew + SDKMAN (host-gated) + shell: bash + run: | + cd dsl/camel-jbang/camel-launcher + CAMEL_PACKAGE_TEST_MODE=true CAMEL_PACKAGE_TEST_VERSION="$TEST_VERSION" \ + bash src/jreleaser/bin/camel-validate.sh all + + - name: Run POSIX validator unit tests + shell: bash + run: | + cd dsl/camel-jbang/camel-launcher + mvn -B -ntp test -pl . -Dtest=PackageNativeValidationTest + + # ── Windows (install.ps1 unit tests) ────────────────────────────── + windows-validator: + runs-on: windows-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 Review Comment: 7.0.1 is available https://github.com/actions/checkout/releases/tag/v7.0.1 ########## .github/workflows/package-native-validation.yml: ########## @@ -0,0 +1,155 @@ +# +# 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-native validation + +on: + push: + branches: + - main + paths: + - 'dsl/camel-jbang/camel-launcher/**' + - 'tooling/camel-exe/**' + - '.github/workflows/package-native-validation.yml' + pull_request: + branches: + - main + paths: + - 'dsl/camel-jbang/camel-launcher/**' + - 'tooling/camel-exe/**' + - '.github/workflows/package-native-validation.yml' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + # ── macOS / Linux (POSIX validators) ────────────────────────────── + posix-validator: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, ubuntu-latest] + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 Review Comment: 7.0.1 is available https://github.com/actions/checkout/releases/tag/v7.0.1 -- 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]
