Created
September 1, 2020 00:58
-
-
Save teyc/6a1d7c5e474d59da95b7c1c67ac8e7e4 to your computer and use it in GitHub Desktop.
CI/CD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Big idea - package following files by convention | |
# NuGetPackage/README.txt | |
# NuGetPackage/tools/install.ps1 | |
$nuspec = @" | |
<?xml version="1.0"?> | |
<package > | |
<metadata> | |
<id>%project.name%</id> | |
<version>%PackageVersion%</version> | |
<title>%PackageTitle%</title> | |
<authors>$author</authors> | |
<owners>$owners</owners> | |
<description>%PackageDescription%</description> | |
</metadata> | |
</package> | |
"@ | |
If (Test-Path -PathType Container %project.name%\NuGetPackage) | |
{ | |
$nuspec = $nuspec -replace '</package>','<files><file src="NuGetPackage\**" target="" /></files></package>' | |
} | |
$nuspec | Out-File "%project.name%\%project.name%.nuspec" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If (-not (Get-Module VSSetup)) | |
{ | |
Install-Module VSSetup -Scope CurrentUser | |
} | |
$MSBuildPath = "$((Get-VSSetupInstance).InstallationPath)\MSBuild\Current\Bin\MSBuild.exe" | |
Function Invoke-MSBuild | |
{ | |
param ($solution) | |
pushd (gi $solution).Directory.FullName | |
C:\Bin\nuget.exe restore | |
& $MSBuildPath $solution "-p:Configuration=Debug" | |
popd | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment