From bf3cf2c12f070b413f6661b38f4dd9d93964c2e7 Mon Sep 17 00:00:00 2001 From: Clemens Vasters Date: Mon, 13 Jul 2026 09:40:18 +0200 Subject: [PATCH] Fix C workflow Windows configure and attach installer-named release assets Two C-workflow (c.yml) changes, split out of the R SDK PR so the C CI/release changes can be reviewed on their own: 1. Fix the `Build and Test (windows-latest)` CMake configure failure. The Configure CMake steps run under PowerShell, which splits unquoted native arguments at the decimal point, so -DCMAKE_POLICY_VERSION_MINIMUM=3.5 reached CMake as 3 (and -DJSON_STRUCTURE_VERSION=0.1.0 as 0). The current windows-2025-vs2026 runner image ships CMake 4.3, which rejects the truncated value "3". Quote the -D arguments in all three Configure CMake steps so PowerShell forwards them intact. Bash on Linux/macOS was unaffected. Also fixes the version being silently set to 0. 2. Attach installer-named release archives (json_structure--.tar.gz) to the GitHub Release so the Ruby and R runtime downloaders can fetch the prebuilt library by a predictable URL. Adds contents:write permission, an asset_basename matrix, and two steps to the tag-only release job. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/c.yml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/c.yml b/.github/workflows/c.yml index 7060ec3..80cf881 100644 --- a/.github/workflows/c.yml +++ b/.github/workflows/c.yml @@ -57,7 +57,7 @@ jobs: - name: Configure CMake working-directory: c - run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DJSON_STRUCTURE_VERSION=${{ steps.get_version.outputs.VERSION }} + run: cmake -B build "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" "-DJSON_STRUCTURE_VERSION=${{ steps.get_version.outputs.VERSION }}" - name: Build working-directory: c @@ -106,7 +106,7 @@ jobs: - name: Configure CMake (Debug) working-directory: c - run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DJSON_STRUCTURE_VERSION=${{ steps.get_version.outputs.VERSION }} + run: cmake -B build "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" "-DJSON_STRUCTURE_VERSION=${{ steps.get_version.outputs.VERSION }}" - name: Build working-directory: c @@ -125,7 +125,7 @@ jobs: needs: [build-and-test, memory-check] if: startsWith(github.ref, 'refs/tags/v') permissions: - contents: read + contents: write strategy: fail-fast: false matrix: @@ -133,10 +133,13 @@ jobs: include: - os: ubuntu-latest artifact_name: json_structure-linux-x64 + asset_basename: json_structure-linux-x86_64 - os: macos-latest artifact_name: json_structure-macos-x64 + asset_basename: json_structure-macos-arm64 - os: windows-latest artifact_name: json_structure-windows-x64 + asset_basename: json_structure-windows-x86_64 steps: - uses: actions/checkout@v6 @@ -170,7 +173,7 @@ jobs: - name: Configure CMake working-directory: c - run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DJSON_STRUCTURE_VERSION=${{ steps.get_version.outputs.VERSION }} + run: cmake -B build "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" "-DJSON_STRUCTURE_VERSION=${{ steps.get_version.outputs.VERSION }}" - name: Build working-directory: c @@ -208,3 +211,18 @@ jobs: with: name: ${{ matrix.artifact_name }}-${{ steps.get_version.outputs.VERSION }} path: c/${{ matrix.artifact_name }}-${{ steps.get_version.outputs.VERSION }}.zip + + # Attach installer-compatible, unversioned .tar.gz assets to the GitHub + # Release so the Ruby and R SDK downloaders can fetch them by predictable + # URL: releases/download/vX.Y.Z/json_structure--.tar.gz + - name: Create installer-compatible archive + working-directory: c + shell: bash + run: | + cd staging + tar czf "../${{ matrix.asset_basename }}.tar.gz" * + + - name: Attach archive to GitHub Release + uses: softprops/action-gh-release@v2 + with: + files: c/${{ matrix.asset_basename }}.tar.gz