Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 47 additions & 23 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
PLATFORM_MATRIX: ${{ steps.load-platform-matrix.outputs.PLATFORM_MATRIX }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: load-platform-matrix
id: load-platform-matrix
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
runs-on: ${{ matrix.host.RUNNER }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: true

Expand All @@ -91,7 +91,6 @@ jobs:
os: ${{ matrix.host.OS }}
target: ${{ matrix.host.TARGET }}
github-token: ${{ secrets.GITHUB_TOKEN }}
engine-version: ${{ matrix.engine.version }}

- uses: actions/cache@v4
with:
Expand All @@ -104,7 +103,6 @@ jobs:
run: |
cargo zigbuild -r --target ${{ matrix.host.TARGET }}.2.17
mkdir -p target/release
cp target/*/release/libglide_rs.so target/release/

- name: Build native libs
if: ${{ !contains(matrix.host.TARGET, 'linux-gnu') }}
Expand All @@ -116,18 +114,19 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.host.TARGET }}
if-no-files-found: error
path: |
rust/target/release/*.so
rust/target/release/*.dylib
rust/target/release/*.dll
rust/target/${{ matrix.host.TARGET }}/release/*.so
rust/target/${{ matrix.host.TARGET }}/release/*.dylib
rust/target/${{ matrix.host.TARGET }}/release/*.dll

build-package-to-publish:
needs: [set-release-version, create-binaries]
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ needs.set-release-version.outputs.RELEASE_VERSION }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Download published artifacts
uses: actions/download-artifact@v4
Expand All @@ -154,25 +153,28 @@ jobs:
- name: Pack the client
working-directory: sources/Valkey.Glide
run: |
dotnet build Valkey.Glide.csproj --configuration Release /property:Version=${{ env.RELEASE_VERSION }}
dotnet pack Valkey.Glide.csproj --configuration Release -p:NuspecProperties=version=${{ env.RELEASE_VERSION }}
dotnet build Valkey.Glide.csproj --configuration Release /property:Version=$RELEASE_VERSION
dotnet pack Valkey.Glide.csproj --configuration Release -p:NuspecProperties=version=$RELEASE_VERSION
tree -h bin/Release
unzip -l bin/Release/Valkey.Glide.${{ env.RELEASE_VERSION }}.nupkg
unzip -l bin/Release/Valkey.Glide.${{ env.RELEASE_VERSION }}.symbols.nupkg
unzip -l bin/Release/Valkey.Glide.$RELEASE_VERSION.nupkg
unzip -l bin/Release/Valkey.Glide.$RELEASE_VERSION.snupkg
env:
SkipCargo: true

- name: Upload artifacts to publish
uses: actions/upload-artifact@v4
with:
name: package
path: sources/Valkey.Glide/bin/Release/Valkey.Glide.*.nupkg
if-no-files-found: error
path: sources/Valkey.Glide/bin/Release/Valkey.Glide.*nupkg

publish:
environment: Release
if: ${{ (inputs.nuget_publish == true || github.event_name == 'push') && github.repository_owner == 'valkey-io' }}
needs: [build-package-to-publish]
needs: [build-package-to-publish, set-release-version]
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ needs.set-release-version.outputs.RELEASE_VERSION }}
steps:
- name: Download package
uses: actions/download-artifact@v4
Expand All @@ -182,11 +184,31 @@ jobs:
- name: Publish
run: |
ls -lh
dotnet nuget push Valkey.Glide.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
dotnet nuget push Valkey.Glide.$RELEASE_VERSION.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json

- name: Wait for package to be ready for download
run: |
dotnet new console --name temp-check --output . --framework net8.0
TIMEOUT=600 # 10 minutes
INTERVAL=10 # 10 seconds
ELAPSED=0

while [ $ELAPSED -lt $TIMEOUT ]; do
echo "Checking availability... (${ELAPSED}s elapsed)"
if dotnet add package Valkey.Glide --version $RELEASE_VERSION ; then
echo "Package is now available!"
exit 0
fi
sleep $INTERVAL
ELAPSED=$((ELAPSED + INTERVAL))
dotnet nuget locals all --clear
done

echo "Timeout: Package is not available after ${TIMEOUT}s"
exit 1

test:
needs: [publish, set-release-version, load-platform-matrix]
if: ${{ !cancelled() }}
timeout-minutes: 35
strategy:
# Run all jobs
Expand All @@ -197,7 +219,9 @@ jobs:
env:
RELEASE_VERSION: ${{ needs.set-release-version.outputs.RELEASE_VERSION }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: true

- name: Download package
if: ${{ needs.publish.result == 'skipped' }}
Expand Down Expand Up @@ -232,15 +256,15 @@ jobs:
shell: bash
run: |
dotnet remove reference $(dotnet list reference | tail -n +3)
dotnet add package Valkey.Glide --version ${{ env.RELEASE_VERSION }}
dotnet add package Valkey.Glide --version $RELEASE_VERSION
git diff

- name: Install engine
- name: Install server
# TODO activate this on windows once fixed, see https://github.com/valkey-io/valkey-glide-csharp/issues/6
if: ${{ matrix.host.OS != 'windows' }}
uses: ./.github/workflows/install-engine
uses: ./.github/workflows/install-server
with:
engine-version: 8.1
server-version: 8.1
target: ${{ matrix.host.TARGET }}

- name: Run tests
Expand Down Expand Up @@ -268,5 +292,5 @@ jobs:
RELEASE_VERSION: ${{ needs.set-release-version.outputs.RELEASE_VERSION }}
steps:
- name: Remove package from NuGet due to test failures
if: ${{ needs.test.result == 'failure' && needs.publish.result == 'success' }}
run: dotnet nuget delete Valkey.Glide ${{ env.RELEASE_VERSION }} --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --non-interactive
if: ${{ (needs.test.result == 'failure' && needs.publish.result == 'success') || needs.publish.result == 'failure' }}
run: dotnet nuget delete Valkey.Glide $RELEASE_VERSION --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --non-interactive
4 changes: 3 additions & 1 deletion Valkey.Glide.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".files", ".files", "{1F0580
.editorconfig = .editorconfig
.gitignore = .gitignore
DEVELOPER.md = DEVELOPER.md
..\.github\workflows\csharp.yml = ..\.github\workflows\csharp.yml
README.md = README.md
icon.png = icon.png
.github\workflows\csharp.yml = .github\workflows\csharp.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", "{9C73AD22-2B57-455C-B623-C30EE8F77B44}"
Expand Down
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion sources/Valkey.Glide/Valkey.Glide.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<Deterministic>true</Deterministic>

<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>symbols.nupkg</SymbolPackageFormat>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
Expand Down
10 changes: 5 additions & 5 deletions sources/Valkey.Glide/Valkey.Glide.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<owners>Valkey GLIDE Maintainers</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>General Language Independent Driver for the Enterprise (GLIDE) for Valkey</description>
<projectUrl>https://github.com/valkey-io/valkey-glide/csharp</projectUrl>
<projectUrl>https://github.com/valkey-io/valkey-glide-csharp</projectUrl>
<license type="expression">Apache-2.0</license>
<!-- TODO other fields from schema: https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Packaging/compiler/resources/nuspec.xsd -->
<!-- iconUrl -->
<readme>README.md</readme> <!-- TODO readme isn't used or isn't renderred -->
<repository type="git" url="https://github.com/valkey-io/valkey-glide" /> <!-- TODO: commit="$GitCommitId$" -->
<readme>README.md</readme>
<icon>icon.png</icon>
<repository type="git" url="https://github.com/valkey-io/valkey-glide-csharp" /> <!-- TODO: commit="$GitCommitId$" -->
<tags>open-source performance database csharp key-value fault-tolerance cache reliability pubsub valkey valkey-client</tags>
<copyright>Copyright © 2025 Valkey GLIDE Maintainers</copyright>
<!-- TODO include changelog (as a file or as GH release link) starting from the second release -->
Expand All @@ -29,7 +29,6 @@

<!-- PDB files and sources are included into symbol package only -->
<file src="bin\Release\**\Valkey.Glide.pdb" target="lib" />
<file src="**\*.cs" target="src" />

<!-- TODO: make binaries optional/conditional, build fails on a dev's PC who doesn't have all files. Alternative: use different nuspec files -->
<!-- see runtime IDs in https://learn.microsoft.com/en-us/dotnet/core/rid-catalog -->
Expand All @@ -40,5 +39,6 @@
<file src="../../bin/x86_64-pc-windows-msvc/libglide_rs.dll" target="runtimes/win-x64/native" />
<file src="../../bin/aarch64-pc-windows-msvc/libglide_rs.dll" target="runtimes/win-arm64/native" />
<file src="../../README.md" target="" />
<file src="../../icon.png" target="" />
</files>
</package>
Loading