From 55228307b34657f7cb0df549791ef2ca73090baa Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Tue, 26 Nov 2024 21:56:48 +0000 Subject: [PATCH] Make valid json --- .../reusable-ros-tooling-win-build.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index 8e21c0b..eecdbf6 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -59,7 +59,19 @@ jobs: token: ${{ github.token }} github-binarycache: true - - run: Write-Output ${{ steps.vcpkg.outputs.vcpkg-cmake-config }} # just for debugging + - name: Make json from vcpkg cmake + id: vcpkg-json + run: | + # Replace forward slashes with backslashes (for Windows) + $singlePath = "${{ steps.vcpkg.outputs.vcpkg-cmake-config }}" -replace "/", "\" + # Escape backlashes + $doublePath = $singlePath -replace "\\", "\\" + Write-Host "Transformed output: $doublePath" + # Split the string on spaces and assign to variables + $variables = $doublePath -split ' ' + "toolchain-file=$variables[0]" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append + "target-triplet=$variables[1]" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append + "manifest-mode=$variables[2]" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append - uses: ros-tooling/setup-ros@0.7.9 with: @@ -122,7 +134,9 @@ jobs: { "build": { "cmake-args": [ - ${{ steps.vcpkg.outputs.vcpkg-cmake-config }}, + "${{ steps.vcpkg-json.outputs.toolchain-file }}", + "${{ steps.vcpkg-json.outputs.target-triplet }}", + "${{ steps.vcpkg-json.outputs.manifest-mode }}" ] }, "test": {