From 1ef6df5a5704bfb00e1aa2b42ba3b7cbbf79cca2 Mon Sep 17 00:00:00 2001 From: abhinavminhas Date: Sun, 27 Jul 2025 11:37:03 +1000 Subject: [PATCH 1/5] Install dotnet SDK acrh x64 for MacOS --- .github/workflows/build.yml | 8 +++ .../workflows/install-dotnet-core/action.yml | 72 +++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 .github/workflows/install-dotnet-core/action.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 572e36e..53e44ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,15 @@ jobs: with: fetch-depth: 0 + - name: Install .NET Core SDK [ Version - ${{ matrix.dotnet-version }} ] (MacOS) + if: ${{ runner.os == 'macOS' }} + uses: ./.github/workflows/install-dotnet-core + with: + dotnet-version: ${{ matrix.dotnet-version }} + architecture: x64 + - name: Dotnet Version (${{ matrix.dotnet-version }}) + if: ${{ runner.os != 'macOS' }} uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ matrix.dotnet-version }} diff --git a/.github/workflows/install-dotnet-core/action.yml b/.github/workflows/install-dotnet-core/action.yml new file mode 100644 index 0000000..d15e903 --- /dev/null +++ b/.github/workflows/install-dotnet-core/action.yml @@ -0,0 +1,72 @@ +name: Install .NET Core SDK +description: Installs a specified .NET Core SDK version + +inputs: + dotnet-version: + description: The version of .NET SDK to install (e.g., 3.1.426) + required: true + architecture: + description: Target architecture (e.g., x64 or arm64) + required: true + +runs: + using: "composite" + steps: + - name: Resolve .NET Core SDK Version + shell: bash + env: + RAW_INPUT: ${{ inputs.dotnet-version }} + run: | + DOTNET_CHANNEL="${RAW_INPUT%%.x}" + + RELEASE_INDEX_URL="https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json" + + # Get the URL to the channel-specific releases.json + RELEASES_JSON_URL=$(curl -s $RELEASE_INDEX_URL \ + | jq -r --arg ver "$DOTNET_CHANNEL" ' + .["releases-index"][] + | select(.["channel-version"] == $ver) + | ."releases.json"') + + if [ -z "$RELEASES_JSON_URL" ]; then + echo "Could not resolve releases.json URL for channel $DOTNET_CHANNEL" + exit 1 + fi + + # Download and extract latest SDK version + DOTNET_VERSION=$(curl -s $RELEASES_JSON_URL \ + | jq -r ' + .releases[] + | select(.sdk.version != null) + | .sdk.version' \ + | sort -Vr \ + | head -n1) + + if [ -z "$DOTNET_VERSION" ]; then + echo "Could not resolve SDK version from $RELEASES_JSON_URL" + exit 1 + fi + + echo "Resolved full SDK version: $DOTNET_VERSION" + echo "DOTNET_VERSION=$DOTNET_VERSION" >> $GITHUB_ENV + + - name: Install .NET Core SDK [ ${{ inputs.dotnet-version }} ] + shell: bash + run: | + ARCHITECTURE="${{ inputs.architecture }}" + INSTALL_DIR=$HOME/dotnet + + echo "Installing .NET SDK $DOTNET_VERSION for $ARCHITECTURE..." + mkdir -p "$INSTALL_DIR" + curl -sSL https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh -o dotnet-install.sh + chmod +x dotnet-install.sh + ./dotnet-install.sh --version "$DOTNET_VERSION" --install-dir "$INSTALL_DIR" --architecture "$ARCHITECTURE" + + - name: Add dotnet to PATH + shell: bash + run: echo "$HOME/dotnet" >> $GITHUB_PATH + + - name: Check .NET SDK + shell: bash + run: | + dotnet --info \ No newline at end of file From 126f40e24a46f583343aa9de7187b3b4af4c6794 Mon Sep 17 00:00:00 2001 From: abhinavminhas Date: Sun, 27 Jul 2025 11:54:35 +1000 Subject: [PATCH 2/5] Update target framework --- QueryDB.Core.Tests/QueryDB.Core.Tests.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QueryDB.Core.Tests/QueryDB.Core.Tests.csproj b/QueryDB.Core.Tests/QueryDB.Core.Tests.csproj index c508b11..f27cc2c 100644 --- a/QueryDB.Core.Tests/QueryDB.Core.Tests.csproj +++ b/QueryDB.Core.Tests/QueryDB.Core.Tests.csproj @@ -1,8 +1,8 @@  - - netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0 + netcoreapp3.1 + false From ad3a9a4846fb1a00f38747428f65e15b32167bdd Mon Sep 17 00:00:00 2001 From: abhinavminhas Date: Sun, 27 Jul 2025 12:09:16 +1000 Subject: [PATCH 3/5] Update target framework --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 53e44ae..0c56765 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,16 +49,22 @@ jobs: shell: bash run: | if [[ "${{ matrix.dotnet-version }}" == "3.1"* ]]; then + echo "Building with .NET Core 3.1" dotnet build -f netcoreapp3.1 QueryDB.Core.Tests/QueryDB.Core.Tests.csproj --configuration Release elif [[ "${{ matrix.dotnet-version }}" == "5.0"* ]]; then + echo "Building with .NET Core 5.0" dotnet build -f net5.0 QueryDB.Core.Tests/QueryDB.Core.Tests.csproj --configuration Release elif [[ "${{ matrix.dotnet-version }}" == "6.0"* ]]; then + echo "Building with .NET Core 6.0" dotnet build -f net6.0 QueryDB.Core.Tests/QueryDB.Core.Tests.csproj --configuration Release elif [[ "${{ matrix.dotnet-version }}" == "7.0"* ]]; then + echo "Building with .NET Core 7.0" dotnet build -f net7.0 QueryDB.Core.Tests/QueryDB.Core.Tests.csproj --configuration Release elif [[ "${{ matrix.dotnet-version }}" == "8.0"* ]]; then + echo "Building with .NET Core 8.0" dotnet build -f net8.0 QueryDB.Core.Tests/QueryDB.Core.Tests.csproj --configuration Release elif [[ "${{ matrix.dotnet-version }}" == "9.0"* ]]; then + echo "Building with .NET Core 9.0" dotnet build -f net9.0 QueryDB.Core.Tests/QueryDB.Core.Tests.csproj --configuration Release fi From 3afbe4ae76bdf08cd88aead9575af62196bbb32f Mon Sep 17 00:00:00 2001 From: abhinavminhas Date: Sun, 27 Jul 2025 12:10:31 +1000 Subject: [PATCH 4/5] Update target framework --- QueryDB.Core.Tests/QueryDB.Core.Tests.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QueryDB.Core.Tests/QueryDB.Core.Tests.csproj b/QueryDB.Core.Tests/QueryDB.Core.Tests.csproj index f27cc2c..65543fb 100644 --- a/QueryDB.Core.Tests/QueryDB.Core.Tests.csproj +++ b/QueryDB.Core.Tests/QueryDB.Core.Tests.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 - + + netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0 false From e62ebd709b7d4f8dc113bff2c5ac7802eb59348b Mon Sep 17 00:00:00 2001 From: abhinavminhas Date: Wed, 30 Jul 2025 21:14:40 +1000 Subject: [PATCH 5/5] Revert install dotnet SDK acrh x64 for MacOS --- .github/workflows/build.yml | 8 --- .../workflows/install-dotnet-core/action.yml | 72 ------------------- 2 files changed, 80 deletions(-) delete mode 100644 .github/workflows/install-dotnet-core/action.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c56765..611f591 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,15 +26,7 @@ jobs: with: fetch-depth: 0 - - name: Install .NET Core SDK [ Version - ${{ matrix.dotnet-version }} ] (MacOS) - if: ${{ runner.os == 'macOS' }} - uses: ./.github/workflows/install-dotnet-core - with: - dotnet-version: ${{ matrix.dotnet-version }} - architecture: x64 - - name: Dotnet Version (${{ matrix.dotnet-version }}) - if: ${{ runner.os != 'macOS' }} uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ matrix.dotnet-version }} diff --git a/.github/workflows/install-dotnet-core/action.yml b/.github/workflows/install-dotnet-core/action.yml deleted file mode 100644 index d15e903..0000000 --- a/.github/workflows/install-dotnet-core/action.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Install .NET Core SDK -description: Installs a specified .NET Core SDK version - -inputs: - dotnet-version: - description: The version of .NET SDK to install (e.g., 3.1.426) - required: true - architecture: - description: Target architecture (e.g., x64 or arm64) - required: true - -runs: - using: "composite" - steps: - - name: Resolve .NET Core SDK Version - shell: bash - env: - RAW_INPUT: ${{ inputs.dotnet-version }} - run: | - DOTNET_CHANNEL="${RAW_INPUT%%.x}" - - RELEASE_INDEX_URL="https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json" - - # Get the URL to the channel-specific releases.json - RELEASES_JSON_URL=$(curl -s $RELEASE_INDEX_URL \ - | jq -r --arg ver "$DOTNET_CHANNEL" ' - .["releases-index"][] - | select(.["channel-version"] == $ver) - | ."releases.json"') - - if [ -z "$RELEASES_JSON_URL" ]; then - echo "Could not resolve releases.json URL for channel $DOTNET_CHANNEL" - exit 1 - fi - - # Download and extract latest SDK version - DOTNET_VERSION=$(curl -s $RELEASES_JSON_URL \ - | jq -r ' - .releases[] - | select(.sdk.version != null) - | .sdk.version' \ - | sort -Vr \ - | head -n1) - - if [ -z "$DOTNET_VERSION" ]; then - echo "Could not resolve SDK version from $RELEASES_JSON_URL" - exit 1 - fi - - echo "Resolved full SDK version: $DOTNET_VERSION" - echo "DOTNET_VERSION=$DOTNET_VERSION" >> $GITHUB_ENV - - - name: Install .NET Core SDK [ ${{ inputs.dotnet-version }} ] - shell: bash - run: | - ARCHITECTURE="${{ inputs.architecture }}" - INSTALL_DIR=$HOME/dotnet - - echo "Installing .NET SDK $DOTNET_VERSION for $ARCHITECTURE..." - mkdir -p "$INSTALL_DIR" - curl -sSL https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh -o dotnet-install.sh - chmod +x dotnet-install.sh - ./dotnet-install.sh --version "$DOTNET_VERSION" --install-dir "$INSTALL_DIR" --architecture "$ARCHITECTURE" - - - name: Add dotnet to PATH - shell: bash - run: echo "$HOME/dotnet" >> $GITHUB_PATH - - - name: Check .NET SDK - shell: bash - run: | - dotnet --info \ No newline at end of file