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
29 changes: 29 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,35 @@ jobs:
if: contains(matrix.architecture, 'win-')
run: |
$(Get-FileHash ./${{ env.release }}/dev-proxy-installer-${{ matrix.architecture }}-${{ github.ref_name }}.exe -Algorithm SHA256).Hash
publish_nuget:
name: Publish to NuGet
needs: [publish_binaries]
runs-on: ubuntu-latest
environment:
name: gh_releases
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
dotnet-version: 10.0.x
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Pack
run: >
dotnet pack ./DevProxy.Abstractions/DevProxy.Abstractions.csproj
-c Release
-p:PackageVersion=${{ steps.get_version.outputs.VERSION }}
Comment thread
waldekmastykarz marked this conversation as resolved.
-p:Version=${{ steps.get_version.outputs.VERSION }}
-o ./nupkg
- name: Push to NuGet
run: >
dotnet nuget push ./nupkg/DevProxy.Abstractions.${{ steps.get_version.outputs.VERSION }}.nupkg
--api-key ${{ secrets.NUGET_API_KEY }}
--source https://api.nuget.org/v3/index.json
Comment thread
waldekmastykarz marked this conversation as resolved.
--skip-duplicate
create_release:
name: Create Release
needs: [publish_binaries]
Expand Down
19 changes: 19 additions & 0 deletions DevProxy.Abstractions/DevProxy.Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,27 @@
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<IsPackable>true</IsPackable>
<PackageId>DevProxy.Abstractions</PackageId>
<Title>Dev Proxy Abstractions</Title>
<Authors>Dev Proxy</Authors>
<Description>Abstractions for building custom Dev Proxy plugins. Dev Proxy is an API simulator that helps you effortlessly test your app beyond the happy path.</Description>
<PackageTags>devproxy;api;proxy;testing;mocking;plugins</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://aka.ms/devproxy</PackageProjectUrl>
<RepositoryUrl>https://github.com/dotnet/dev-proxy</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
Comment thread
waldekmastykarz marked this conversation as resolved.
<!-- NU5104: stable package depends on prerelease System.CommandLine; suppress until a stable version is available -->
<NoWarn>NU5104</NoWarn>
</PropertyGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
<None Include="..\media\icon.png" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Markdig" Version="0.41.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.4" />
Expand Down
42 changes: 42 additions & 0 deletions DevProxy.Abstractions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Dev Proxy Abstractions

[![NuGet Version](https://img.shields.io/nuget/v/DevProxy.Abstractions)](https://www.nuget.org/packages/DevProxy.Abstractions)
[![NuGet Downloads](https://img.shields.io/nuget/dt/DevProxy.Abstractions)](https://www.nuget.org/packages/DevProxy.Abstractions)

Abstractions for building custom [Dev Proxy](https://aka.ms/devproxy) plugins. Dev Proxy is an API simulator that helps you effortlessly test your app beyond the happy path.

## What This Package Does

This package provides the interfaces, base classes, and models needed to build custom Dev Proxy plugins. Use it when you want to extend Dev Proxy with your own functionality.

## Usage

Create a new class library project and add a reference to this package:

```bash
dotnet add package DevProxy.Abstractions
```

Then, implement the `IPlugin` interface or inherit from `BasePlugin`:

```csharp
using DevProxy.Abstractions.Plugins;
using DevProxy.Abstractions.Proxy;
using Microsoft.Extensions.Logging;

public class MyPlugin(
ILogger logger,
ISet<UrlToWatch> urlsToWatch) : BasePlugin(logger, urlsToWatch)
{
public override string Name => nameof(MyPlugin);

public override async Task BeforeRequestAsync(
ProxyRequestArgs e,
CancellationToken cancellationToken)
{
// Your custom logic here
}
}
```

For more information, see the [Dev Proxy documentation](https://aka.ms/devproxy/docs).
1 change: 1 addition & 0 deletions DevProxy.Plugins/DevProxy.Plugins.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<NoWarn>CS1998</NoWarn>
Expand Down
1 change: 1 addition & 0 deletions DevProxy/DevProxy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading