Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,6 @@ __pycache__/
*.xsd.cs

.DS_Store

# ci.global.json is used in CI; local builds are unconstrained
global.json
16 changes: 16 additions & 0 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,32 @@ function Publish-Docs($version)
if($LASTEXITCODE -ne 0) { throw "Build failed" }
}

function Remove-GlobalJson
{
if(Test-Path ./global.json) { rm ./global.json }
}

function Create-GlobalJson
{
# It's very important that SeqCli use the same .NET SDK version as its matching Seq version, to avoid
# container and installer bloat. But, highly-restrictive global.json files are annoying during development. So,
# we create a temporary global.json from ci.global.json to use during CI builds.
Remove-GlobalJson
cp ./ci.global.json global.json
}

Write-Output "Building version $version"

$env:Path = "$pwd/.dotnetcli;$env:Path"

Clean-Output
Create-ArtifactDir
Create-GlobalJson
Restore-Packages
Publish-Archives($version)
Publish-DotNetTool($version)
Execute-Tests($version)
Publish-Docs($version)
Remove-GlobalJson

Pop-Location
2 changes: 1 addition & 1 deletion Setup.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ErrorActionPreference = "Stop"

$RequiredDotnetVersion = $(cat ./global.json | convertfrom-json).sdk.version
$RequiredDotnetVersion = $(cat ./ci.global.json | convertfrom-json).sdk.version

New-Item -ItemType Directory -Force "./build/" | Out-Null

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion seqcli.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sln", "sln", "{2EA56595-519
.gitignore = .gitignore
appveyor.yml = appveyor.yml
Build.ps1 = Build.ps1
global.json = global.json
LICENSE = LICENSE
README.md = README.md
setup.sh = setup.sh
Build.Docker.ps1 = Build.Docker.ps1
docker-publish.ps1 = docker-publish.ps1
Setup.ps1 = Setup.ps1
CONTRIBUTING.md = CONTRIBUTING.md
ci.global.json = ci.global.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{3587B633-0C03-4235-8903-6226900328F1}"
Expand Down
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -o pipefail
sudo apt-get update || true
sudo apt-get install -y --no-install-recommends jq

RequiredDotnetVersion=$(jq -r '.sdk.version' global.json)
RequiredDotnetVersion=$(jq -r '.sdk.version' ci.global.json)

curl https://dot.net/v1/dotnet-install.sh -sSfL --output dotnet-install.sh
chmod +x dotnet-install.sh
Expand Down