Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ jobs:
--git-user-id=zernio-dev \
--git-repo-id=zernio-dotnet

- name: Patch User-Agent to use package version
run: |
sed -i 's|UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp");|UserAgent = WebUtility.UrlEncode($"Zernio/{typeof(Configuration).Assembly.GetName().Version?.ToString(3) ?? "unknown"}");|' src/Zernio/Client/Configuration.cs

- name: Patch README install instructions
run: |
python3 -c "
Expand Down Expand Up @@ -162,6 +166,7 @@ jobs:
--additional-properties=packageName=Late,targetFramework=net8.0,library=httpclient \
--git-user-id=zernio-dev \
--git-repo-id=zernio-dotnet
sed -i 's|UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp");|UserAgent = WebUtility.UrlEncode($"Late/{typeof(Configuration).Assembly.GetName().Version?.ToString(3) ?? "unknown"}");|' "$LATE_BUILD_DIR/src/Late/Client/Configuration.cs"
find "$LATE_BUILD_DIR" -name "*.csproj" -exec sed -i "s/<Version>.*<\/Version>/<Version>${{ steps.version.outputs.nuget_version }}<\/Version>/" {} \;
dotnet build "$LATE_BUILD_DIR" -c Release
dotnet pack "$LATE_BUILD_DIR" -c Release --no-build -o "$LATE_BUILD_DIR/nupkg-late"
Expand Down
2 changes: 1 addition & 1 deletion src/Zernio/Client/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public class Configuration : IReadableConfiguration
public Configuration()
{
Proxy = null;
UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp");
UserAgent = WebUtility.UrlEncode($"Zernio/{typeof(Configuration).Assembly.GetName().Version?.ToString(3) ?? "unknown"}");
BasePath = "https://zernio.com/api";
DefaultHeaders = new ConcurrentDictionary<string, string>();
ApiKey = new ConcurrentDictionary<string, string>();
Expand Down