Skip to content

Commit 9b0ddcb

Browse files
committed
Add project files.
1 parent d061fbb commit 9b0ddcb

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

CustomNugetPackage.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
9+
</Project>

CustomNugetPackage.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.9.34414.90
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomNugetPackage", "CustomNugetPackage.csproj", "{F05E5D3A-129E-4821-931A-2B995B885996}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{F05E5D3A-129E-4821-931A-2B995B885996}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{F05E5D3A-129E-4821-931A-2B995B885996}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{F05E5D3A-129E-4821-931A-2B995B885996}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{F05E5D3A-129E-4821-931A-2B995B885996}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {B2D3F55D-DD84-45C0-8237-6617E28EDCDB}
24+
EndGlobalSection
25+
EndGlobal

CustomNugetPackage.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
pool:
2+
name: Azure Pipelines
3+
demands:
4+
- msbuild
5+
- visualstudio
6+
7+
variables:
8+
Version: '1.0.4'
9+
Authors: 'Hogwarts Dev'
10+
Description: 'This package is a wrapper'
11+
ReleaseNotes: 'Create a new package of a .net library and publish as nuget package in the artifacts feed under azure devops'
12+
Tags: 'Dev'
13+
14+
steps:
15+
16+
- task: UseDotNet@2
17+
displayName: '.NET Core 6.x'
18+
inputs:
19+
version: 6.x
20+
21+
- task: NuGetToolInstaller@0
22+
displayName: 'NuGet 6.8.x'
23+
inputs:
24+
versionSpec: 6.8.x
25+
26+
- task: NuGetCommand@2
27+
displayName: 'NuGet restore'
28+
inputs:
29+
restoreSolution: <.Net solution path from the repo> #replace with .Net solution path from the repo
30+
vstsFeed: '<feed_key>' #Use packages from this Azure Artifacts/TFS feed
31+
32+
- task: VSBuild@1
33+
displayName: 'Build solution'
34+
inputs:
35+
solution: <.Net solution path from the repo> #replace with .Net solution path from the repo, Include the selected feed in the generated NuGet.config. You must have Azure Artifacts installed and licensed to select a feed here.
36+
vsVersion: 17.0
37+
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"'
38+
platform: '$(BuildPlatform)'
39+
configuration: '$(BuildConfiguration)'
40+
maximumCpuCount: true
41+
42+
- task: NuGetCommand@2
43+
displayName: 'NuGet pack'
44+
inputs:
45+
command: pack
46+
packagesToPack: '**/<.Net solution>.csproj' #replace with .Net solution name
47+
versioningScheme: byPrereleaseNumber
48+
patchVersion: 2
49+
buildProperties: 'Id=$(id);Version=$(Version);Authors=$(Authors);Desc=$(Description);ReleaseNotes=$(ReleaseNotes);Tags=$(Tags)'
50+
51+
- task: NuGetCommand@2
52+
displayName: 'NuGet push'
53+
inputs:
54+
command: push
55+
publishVstsFeed: '<target_feed>' #Select a feed hosted in this account. You must have Azure Artifacts installed and licensed to select a feed here.
56+
57+
- task: PublishBuildArtifacts@1
58+
displayName: 'Publish the Artifacts'
59+
inputs:
60+
PathtoPublish: '$(build.artifactstagingdirectory)'
61+
ArtifactName: '$(Parameters.ArtifactName)'
62+
condition: succeededOrFailed()

0 commit comments

Comments
 (0)