Skip to content

Commit fcb2ec0

Browse files
authored
Publish nightly packages to Azure DevOps (#1020)
* Update nightly build definitions * Update nightly package feed name * Update feed information * Use scoped name in publishVstsFeed argument * Remove nightly.ps1 * Update nightly documentation * ADO doesn't let us check package metadata
1 parent 511a307 commit fcb2ec0

File tree

8 files changed

+34
-52
lines changed

8 files changed

+34
-52
lines changed

Documentation/ConsumeNightlyBuild.md

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# Consume nightly build
22

3-
You can check the metadata of nightly build packages here:
4-
5-
MSBuild https://www.myget.org/feed/coverlet-dev/package/nuget/coverlet.msbuild
6-
VSTest collector https://www.myget.org/feed/coverlet-dev/package/nuget/coverlet.collector
7-
.NET tools https://www.myget.org/feed/coverlet-dev/package/nuget/coverlet.console
8-
93
To consume nightly builds, create a `NuGet.Config` in your root solution directory and add the following content:
104

115
```xml
@@ -14,7 +8,7 @@ To consume nightly builds, create a `NuGet.Config` in your root solution directo
148
<packageSources>
159
<clear />
1610
<!-- Coverlet nightly build feed -->
17-
<add key="coverletNightly" value="https://www.myget.org/F/coverlet-dev/api/v3/index.json" />
11+
<add key="coverletNightly" value="https://pkgs.dev.azure.com/tonerdo/coverlet/_packaging/coverlet-nightly/nuget/v3/index.json" />
1812
<!-- Default nuget feed -->
1913
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
2014
<!-- Add all other needed feed -->
@@ -31,31 +25,19 @@ Visual Studio:
3125
NuGet (Package Manager console):
3226

3327
```powershell
34-
PM> Install-Package coverlet.msbuild -Version 2.6.25-g6209239d69 -Source https://www.myget.org/F/coverlet-dev/api/v3/index.json
28+
PM> Install-Package coverlet.msbuild -Version 3.0.0-preview.18.g183cbed8a6 -Source https://pkgs.dev.azure.com/tonerdo/coverlet/_packaging/coverlet-nightly/nuget/v3/index.json
3529
```
3630

3731
.NET CLI:
3832

3933
```bash
40-
dotnet add package coverlet.msbuild --version 2.6.25-g6209239d69 --source https://www.myget.org/F/coverlet-dev/api/v3/index.json
34+
dotnet add package coverlet.msbuild --version 3.0.0-preview.18.g183cbed8a6 --source https://pkgs.dev.azure.com/tonerdo/coverlet/_packaging/coverlet-nightly/nuget/v3/index.json
4135
```
4236

4337
MSBuild project file:
4438

4539
```xml
46-
<PackageReference Include="coverlet.msbuild" Version="2.6.25-g6209239d69" />
40+
<PackageReference Include="coverlet.msbuild" Version="3.0.0-preview.18.g183cbed8a6" />
4741
```
4842

49-
### How to verify version
50-
51-
You can understand which version you're using by comparing nightly build release date with repo commits.
52-
53-
For instance if we want to consume last msbuild nightly build:
54-
55-
* Go to https://www.myget.org/feed/coverlet-dev/package/nuget/coverlet.msbuild
56-
* Scroll down the page and check release date
57-
![File](images/nightly_1.PNG)
58-
* Go to repo commits and compare date and first part of commit hash
59-
![File](images/nightly_2.PNG)
60-
61-
As you can see we build at 00.00 UTC and build takes some seconds, so it's possible that release date won't be the same as repo commits.
43+
_Note: The version provided here is just an example, you should use the latest when possible_

Documentation/images/nightly.PNG

12.9 KB
Loading

Documentation/images/nightly_1.PNG

-15.6 KB
Binary file not shown.

Documentation/images/nightly_2.PNG

-134 KB
Binary file not shown.

coverlet.sln

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
3535
Directory.Build.props = Directory.Build.props
3636
Directory.Build.targets = Directory.Build.targets
3737
global.json = global.json
38-
eng\nightly.ps1 = eng\nightly.ps1
3938
EndProjectSection
4039
EndProject
4140
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.tests.projectsample.excludedbyattribute", "test\coverlet.tests.projectsample.excludedbyattribute\coverlet.tests.projectsample.excludedbyattribute.csproj", "{D6B14F2F-9E7D-4D2C-BAC8-48834F853ED6}"

eng/azure-pipelines-nightly.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,35 @@
11
pool:
22
vmImage: 'windows-2019'
3+
34
steps:
45
- task: UseDotNet@2
56
inputs:
67
version: 2.2.402
8+
displayName: Install .NET Core SDK 2.2.402
9+
710
- task: UseDotNet@2
811
inputs:
912
version: 3.1.401
10-
- powershell:
11-
.\eng\nightly.ps1 -apiKey $env:APIKEY -source $env:SOURCE
12-
ignoreLASTEXITCODE: true
13-
env:
14-
APIKEY: $(apikey)
15-
SOURCE: $(source)
13+
displayName: Install .NET Core SDK 3.1.401
14+
15+
- task: NuGetAuthenticate@0
16+
displayName: Authenticate with NuGet feeds
17+
18+
- script: dotnet pack -c Release /p:PublicRelease=false
19+
displayName: Create NuGet packages
20+
21+
- task: NuGetCommand@2
22+
inputs:
23+
command: push
24+
packagesToPush: $(Build.SourcesDirectory)/bin/Release/Packages/*.nupkg
25+
nuGetFeedType: internal
26+
publishVstsFeed: coverlet/coverlet-nightly
27+
displayName: Publish NuGet packages
28+
29+
- task: NuGetCommand@2
30+
inputs:
31+
command: push
32+
packagesToPush: $(Build.SourcesDirectory)/bin/Release/Packages/*.snupkg
33+
nuGetFeedType: internal
34+
publishVstsFeed: coverlet/coverlet-nightly
35+
displayName: Publish NuGet symbol packages

eng/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ steps:
22
- task: UseDotNet@2
33
inputs:
44
version: 2.2.402
5-
displayName: Install .NET Core SDK
5+
displayName: Install .NET Core SDK 2.2.402
66

77
- task: UseDotNet@2
88
inputs:
99
version: 3.1.401
10-
displayName: Install .NET Core SDK
10+
displayName: Install .NET Core SDK 3.1.401
1111

1212
- script: dotnet restore
1313
displayName: Restore packages
@@ -19,7 +19,7 @@ steps:
1919
displayName: Pack
2020

2121
- task: DotNetCoreCLI@2
22-
displayName: Test
22+
displayName: Run tests
2323
inputs:
2424
command: test
2525
arguments: -c $(BuildConfiguration) --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[coverlet.collector]*%2c[coverlet.core]*%2c[coverlet.msbuild.tasks]*" /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.xunit.extensions]*"

eng/nightly.ps1

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)