Last active
April 22, 2020 15:13
-
-
Save NikiforovAll/91d5426fb05321562767e35bcbb09676 to your computer and use it in GitHub Desktop.
Build/Delivery scripts for dotnet
This file contains hidden or 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
| *.doc diff=astextplain | |
| *.DOC diff=astextplain | |
| *.docx diff=astextplain | |
| *.DOCX diff=astextplain | |
| *.dot diff=astextplain | |
| *.DOT diff=astextplain | |
| *.pdf diff=astextplain | |
| *.PDF diff=astextplain | |
| *.rtf diff=astextplain | |
| *.RTF diff=astextplain | |
| *.jpg binary | |
| *.png binary | |
| *.gif binary | |
| *.cs text=auto diff=csharp | |
| *.vb text=auto | |
| *.resx text=auto | |
| *.c text=auto | |
| *.cpp text=auto | |
| *.cxx text=auto | |
| *.h text=auto | |
| *.hxx text=auto | |
| *.py text=auto | |
| *.rb text=auto | |
| *.java text=auto | |
| *.html text=auto | |
| *.htm text=auto | |
| *.css text=auto | |
| *.scss text=auto | |
| *.sass text=auto | |
| *.less text=auto | |
| *.js text=auto | |
| *.lisp text=auto | |
| *.clj text=auto | |
| *.sql text=auto | |
| *.php text=auto | |
| *.lua text=auto | |
| *.m text=auto | |
| *.asm text=auto | |
| *.erl text=auto | |
| *.fs text=auto | |
| *.fsx text=auto | |
| *.hs text=auto | |
| *.csproj text=auto | |
| *.vbproj text=auto | |
| *.fsproj text=auto | |
| *.dbproj text=auto | |
| *.sln text=auto eol=crlf | |
| *.sh eol=lf |
This file contains hidden or 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
| .vs/ | |
| .vscode/ | |
| bin/ | |
| obj/ | |
| .nupkgs/ |
This file contains hidden or 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
| theme: jekyll-theme-architect |
This file contains hidden or 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
| @ECHO OFF | |
| PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE" |
This file contains hidden or 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
| [CmdletBinding(PositionalBinding=$false)] | |
| param( | |
| [bool] $CreatePackages = $true, | |
| [bool] $RunTests = $true, | |
| [string] $PullRequestNumber | |
| ) | |
| Write-Host "Run Parameters:" -ForegroundColor Cyan | |
| Write-Host " CreatePackages: $CreatePackages" | |
| Write-Host " RunTests: $RunTests" | |
| Write-Host " dotnet --version:" (dotnet --version) | |
| $packageOutputFolder = "$PSScriptRoot\.nupkgs" | |
| $projectsToBuild = | |
| 'Pipelines.Sockets.Unofficial' | |
| $testsToRun = | |
| 'Pipelines.Sockets.Unofficial.Tests' | |
| if ($PullRequestNumber) { | |
| Write-Host "Building for a pull request (#$PullRequestNumber), skipping packaging." -ForegroundColor Yellow | |
| $CreatePackages = $false | |
| } | |
| Write-Host "Building solution..." -ForegroundColor "Magenta" | |
| dotnet restore ".\Pipelines.Sockets.Unofficial.sln" /p:CI=true | |
| dotnet build ".\Pipelines.Sockets.Unofficial.sln" -c Release /p:CI=true | |
| Write-Host "Done building." -ForegroundColor "Green" | |
| if ($RunTests) { | |
| foreach ($project in $testsToRun) { | |
| Write-Host "Running tests: $project (all frameworks)" -ForegroundColor "Magenta" | |
| Push-Location ".\tests\$project" | |
| dotnet test -c Release | |
| if ($LastExitCode -ne 0) { | |
| Write-Host "Error with tests, aborting build." -Foreground "Red" | |
| Pop-Location | |
| Exit 1 | |
| } | |
| Write-Host "Tests passed!" -ForegroundColor "Green" | |
| Pop-Location | |
| } | |
| } | |
| if ($CreatePackages) { | |
| mkdir -Force $packageOutputFolder | Out-Null | |
| Write-Host "Clearing existing $packageOutputFolder..." -NoNewline | |
| Get-ChildItem $packageOutputFolder | Remove-Item | |
| Write-Host "done." -ForegroundColor "Green" | |
| Write-Host "Building all packages" -ForegroundColor "Green" | |
| foreach ($project in $projectsToBuild) { | |
| Write-Host "Packing $project (dotnet pack)..." -ForegroundColor "Magenta" | |
| dotnet pack ".\src\$project\$project.csproj" --no-build -c Release /p:PackageOutputPath=$packageOutputFolder /p:NoPackageAnalysis=true /p:CI=true | |
| Write-Host "" | |
| } | |
| } | |
| Write-Host "Done." |
This file contains hidden or 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
| { | |
| "sdk": { | |
| "version": "3.1.201", | |
| "rollForward": "latestMajor", | |
| "allowPrerelease": false | |
| } | |
| } |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <configuration> | |
| <packageSources> | |
| <clear /> | |
| <add key="NuGet" value="https://api.nuget.org/v3/index.json" /> | |
| </packageSources> | |
| </configuration> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
src: https://github.com/mgravell/Pipelines.Sockets.Unofficial