# semantic-release-net

> semantic release plugin to deploy dotnet nuget packages to nuget sources.

Latest version **1.3.2** (published 2023-02-23) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install semantic-release-net
pnpm add semantic-release-net
yarn add semantic-release-net
bun add semantic-release-net
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.2 |
| Published | 2023-02-23 |
| First published | 2023-01-19 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 50.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Christoph Bühler |
| Maintainers | cbuehler |
| Keywords | semantic-release, plugin, dotnet, nuget |

## Links

- npm: https://www.npmjs.com/package/semantic-release-net
- Repository: https://github.com/buehler/semantic-release-net
- Homepage: https://github.com/buehler/semantic-release-net#readme
- Issues: https://github.com/buehler/semantic-release-net/issues
- npm.io page: https://npm.io/package/semantic-release-net

## Dependencies (2)

- [glob](https://npm.io/package/glob.md) ^8.1.0
- [execa](https://npm.io/package/execa.md) ^6.1.0

## Recent versions

- 1.3.2 (latest) — 2023-02-23
- 1.3.1 — 2023-02-22
- 1.3.0 — 2023-01-23
- 1.2.2 — 2023-01-23
- 1.2.1 — 2023-01-23
- 1.2.0 — 2023-01-23
- 1.1.0 — 2023-01-20
- 1.0.1 — 2023-01-20
- 1.0.0 — 2023-01-19

## README

# semantic release net

Semantic release plugin to publish .NET packages to NuGet sources.
Performs the following actions:

- verifyConditions: Checks if the default nuget token (`NUGET_TOKEN`) is set,
  or if sources are set, if the corresponding tokens are set.
- prepare: Creates the NuGet packages using `dotnet pack` with the corresponding new
  version and release notes.
- publish: Publishes the NuGet packages to the configured NuGet sources.

Packages are created in their corresponding `bin/$(Configuration)/` folder.
To enable / disable package creation, you can set the `<IsPackable>true</IsPackable>`
option in the `.csproj` file.

## Configuration

If _no_ sources are configured, the `NUGET_TOKEN` env var must be set.
The default nuget source (`https://api.nuget.org/v3/index.json`) is used in this case.

### Options

- `configuration`: The configuration to use for `dotnet pack` (default: `Release`)
- `pack`: Whether the plugin should run `dotnet pack` (default: `true`)
- `additionalPackArgs`: Array of strings to pass as additional arguments to `dotnet pack`
- `additionalPublishArgs`: Array of strings to pass as additional arguments to `dotnet nuget push`
- `sources`: Array of sources to publish to. Each source must have the following properties:
  - `url`: The url of the source
  - `apiKeyEnvVar`: The name of the environment variable that contains the API key for the source

```typescript
// Type definition of the plugin options
export type PluginConfig = {
  configuration?: 'Release' | 'Development';
  pack?: boolean;
  additionalPackArgs?: string[];
  sources?: { url: string; apiKeyEnvVar: string }[];
  additionalPublishArgs?: string[];
};
```

#### Configuration example when using default nuget

```jsonc
// .releaserc.json example
{
  "plugins": [
    [
      "semantic-release-dotnet",
      {
        "configuration": "Release",
        "pack": true,
        "additionalPackArgs": ["/property:PackageIcon=icon.png"],
        "additionalPublishArgs": ["--skip-duplicates"]
      }
    ]
  ]
}
```

#### Configuration example when specifying sources

```jsonc
// .releaserc.json example
{
  "plugins": [
    [
      "semantic-release-dotnet",
      {
        // key/value config of the other example...
        "sources": [
          {
            "url": "https://api.nuget.org/v3/index.json",
            "apiKeyEnvVar": "NUGET_TOKEN"
          },
          {
            "url": "https://nuget.pkg.github.com/buehler/index.json",
            "apiKeyEnvVar": "GH_NUGET_TOKEN"
          }
        ]
      }
    ]
  ]
}
```

---
_Source: https://npm.io/package/semantic-release-net · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
