Skip to content

Commit

Permalink
Improve the dev feed section (Azure#18462)
Browse files Browse the repository at this point in the history
* Improve the dev feed section

* Remove csproj option. Remove multiple feed refs.

* Remove csproj file ref

* Code formatting

* Change aka to full url
  • Loading branch information
jongio authored Feb 9, 2021
1 parent 8c6ae6d commit 21e4628
Showing 1 changed file with 50 additions and 18 deletions.
68 changes: 50 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,46 +251,78 @@ Each library needs to provide a `ApiCompatVersion` property which is set to the
### Releasing a new version of a GA'ed libary
Since the [eng/Packages.Data.props](https://github.com/Azure/azure-sdk-for-net/blob/master/eng/Packages.Data.props) is currently maintained manually, you will need to update the version number for your library in this file when releasing a new version.

## Dev Feed
We publish daily built packages to a [dev feed](https://dev.azure.com/azure-sdk/public/_packaging?_a=feed&feed=azure-sdk-for-net) which can be consumed by adding the dev feed as a package source in Visual Studio.
## NuGet Package Dev Feed

Follow instructions provided [here](https://docs.microsoft.com/nuget/consume-packages/install-use-packages-visual-studio#package-sources) and use `https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json` as the source.
The Azure SDK for .NET releases packages daily from our CI pipeline to our NuGet package dev feed to help developers use and test new libraries before they are officially released to NuGet.

You can also achieve this from the command line.
**Dev Feed Package Browser**:

```nuget.exe sources add -Name "Azure SDK for Net Dev Feed" -Source "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json"```
- https://dev.azure.com/azure-sdk/public/_packaging?_a=feed&feed=azure-sdk-for-net

Open your NuGet.config file to ensure that the dev feed source comes before the public repository source:
**Dev Feed Package Source**:

- https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json

### 1. Add NuGet Package Dev Feed

You have multiple options for referencing the dev feed. You can either add it via the NuGet CLI or manually edit your NuGet.Config file.

#### NuGet CLI

You can add the dev feed using the [NuGet CLI](https://docs.microsoft.com/nuget/reference/nuget-exe-cli-reference), which will add it to the NuGet.Config file.

```bash
nuget sources add -Name "Azure SDK for .NET Dev Feed" -Source "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json"
```

You can then view the list of NuGet package sources with this command:

```bash
nuget sources
```

#### NuGet Config file

You can add the dev feed to your NuGet.Config file, which can be at the Solution, User, or Computer level. See [NuGet.Config file locations and uses](https://docs.microsoft.com/nuget/consume-packages/configuring-nuget-behavior#config-file-locations-and-uses) to locate your NuGet.Config file.

```xml
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Azure SDK for Net Dev Feed" value="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json" protocolVersion="3" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<clear />
<add key="Azure SDK for .NET Dev Feed" value="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
</disabledPackageSources>
</configuration>
```

You can then consume packages from this package source, remember to check the [Include prerelease](https://docs.microsoft.com/nuget/create-packages/prerelease-packages#installing-and-updating-pre-release-packages) box in Visual Studio when searching for the packages.
> You can place a NuGet.Config file in the root of your solution. Projects within the solution will use the feed defined in that file.
### 2. Find NuGet Package

You can use the following options to find the available dev feed packages:

1. Search the Azure SDK for .NET Dev Feed: https://dev.azure.com/azure-sdk/public/_packaging?_a=feed&feed=azure-sdk-for-net
1. In Visual Studio, use the [Package Manager UI](https://docs.microsoft.com/nuget/create-packages/prerelease-packages#installing-and-updating-pre-release-packages), be sure to check "Include prerelease".
1. Use the NuGet CLI, for example `nuget list azure.identity -Prerelease -Allversions`

### 3. Reference NuGet Package

To see the list of packages you can browse the [dev feed](https://dev.azure.com/azure-sdk/public/_packaging?_a=feed&feed=azure-sdk-for-net) and search for the package you are interested in. Or you can do it from the command line via `nuget.exe list -Prelease -Source "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json"`
Now that you have found the package you want to use, it is time to add it to your project file.

To consume the a dev package set the exact version in your project or to consume the latest dev package set the version to `x.y.z-dev.*` for example:
As you can see in the example below, we want to use the `Azure.Data.Tables` version `3.0.0-alpha.*`. By using the `*` in the version number each `dotnet restore` will pull the latest version from the dev feed.

```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.2.0-dev.*" />
<PackageReference Include="Azure.Data.Tables" Version="3.0.0-alpha.*" />
</ItemGroup>
</Project>
```

## Preparing to a release of the new library
## Preparing a new library release

To prepare a package for release you should make use of `.\eng\common\scripts\Prepare-Release.ps1` script passing it appropriate arguments for the package intended for release as well as the release date. This script will correctly update the package version in the repo as well as update DevOps release work items for that release.

Expand Down Expand Up @@ -491,4 +523,4 @@ For more information on how we version see [Versioning](https://github.com/Azure

## Breaking Changes

For information about breaking changes see [Breaking Change Rules](https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/breaking-change-rules.md)
For information about breaking changes see [Breaking Change Rules](https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/breaking-change-rules.md)

0 comments on commit 21e4628

Please sign in to comment.