Skip to content
Closed
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
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: dotnet/nbgv@master
Expand All @@ -30,9 +30,10 @@ jobs:
- run: echo "NBGV_SemVer2 $NBGV_SemVer2"

- name: Add MSBuild to PATH
uses: microsoft/[email protected]

- uses: nuget/setup-nuget@v1
uses: microsoft/setup-msbuild@v2

- name: Setup .NET
uses: nuget/[email protected]
with:
nuget-version: 'latest'

Expand All @@ -48,7 +49,7 @@ jobs:
- name: Dotnet Pack
run: dotnet pack ${{ env.Code_CSProj_File }} --output ${{ env.Release_Folder }} --configuration ${{ env.Configuration }}

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: Articulate.${{ env.NBGV_SemVer2 }}
path: ${{ env.Release_Folder }}/Articulate.*
70 changes: 26 additions & 44 deletions build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,6 @@ $ReleaseFolder = Join-Path -Path $BuildFolder -ChildPath "Release";
$SolutionRoot = Join-Path -Path $RepoRoot "src";
$CodeProjFolder = Join-Path -Path $RepoRoot -ChildPath "src\Articulate";
$CodeCSProj = Join-Path -Path $CodeProjFolder -ChildPath "Articulate.csproj";

# Go get nuget.exe if we don't hae it
$NuGet = "$BuildFolder\nuget.exe"
$FileExists = Test-Path $NuGet
If ($FileExists -eq $False) {
Write-Host "Retrieving nuget.exe..."
$SourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
Invoke-WebRequest $SourceNugetExe -OutFile $NuGet
}

# ensure we have vswhere
New-Item "$BuildFolder\vswhere" -type directory -force
$vswhere = "$BuildFolder\vswhere.exe"
if (-not (test-path $vswhere))
{
Write-Host "Download VsWhere..."
$path = "$ToolsFolder\tmp"
&$nuget install vswhere -OutputDirectory $path
$dir = ls "$path\vswhere.*" | sort -property Name -descending | select -first 1
$file = ls -path "$dir" -name vswhere.exe -recurse
mv "$dir\$file" $vswhere
}

$MSBuild = &$vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | select-object -first 1
if (-not (test-path $MSBuild)) {
throw "MSBuild not found!"
}


if ((Get-Item $ReleaseFolder -ErrorAction SilentlyContinue) -ne $null)
{
Write-Warning "$ReleaseFolder already exists on your local machine. It will now be deleted."
Expand All @@ -43,26 +14,37 @@ if ((Get-Item $ReleaseFolder -ErrorAction SilentlyContinue) -ne $null)

####### DO THE SLN BUILD PART #############

# Get the solution path
$SolutionPath = Join-Path -Path $SolutionRoot -ChildPath "Articulate.sln"

# Build the solution in release mode
$SolutionPath = Join-Path -Path $SolutionRoot -ChildPath "Articulate.sln";

#restore nuget packages
dotnet --version

# Restore packages
Write-Host "Restoring nuget packages..."
& $NuGet restore $SolutionPath
& dotnet restore $SolutionPath
if (-not $?) {
throw "The dotnet restore process returned an error code."
}

# clean sln for all deploys
& $MSBuild "$SolutionPath" /p:Configuration=Release /maxcpucount /t:Clean
if (-not $?)
{
throw "The MSBuild process returned an error code."
# Clean solution
Write-Host "Cleaning solution..."
& dotnet clean $SolutionPath --configuration Release
if (-not $?) {
throw "The dotnet clean process returned an error code."
}

#build
& $MSBuild "$SolutionPath" /p:Configuration=Release /maxcpucount
if (-not $?)
{
throw "The MSBuild process returned an error code."
# Build solution
Write-Host "Executing dotnet build"
& dotnet build $SolutionPath --configuration Release --no-restore
if (-not $?) {
throw "The dotnet build process returned an error code."
}

# dotnet pack (As its a SDK style project, nuget pack was not reading info stored in csproj)
& dotnet pack $CodeCSProj --output $ReleaseFolder --configuration Release
# dotnet pack
Write-Host "Packing Articulate..."
& dotnet pack $SolutionPath --output $ReleaseFolder --configuration Release
if (-not $?) {
throw "The dotnet pack process returned an error code."
}
5 changes: 4 additions & 1 deletion src/Articulate.Tests.Website/Articulate.Tests.Website.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Umbraco.Cms" Version="10.8.1" />
<PackageReference Include="MessagePack" Version="2.5.187" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.11" />
<PackageReference Include="Smidge" Version="4.6.0" />
<PackageReference Include="Umbraco.Cms" Version="10.8.11" />
</ItemGroup>

<Import Project="..\Articulate\build\Articulate.targets" />
Expand Down
11 changes: 7 additions & 4 deletions src/Articulate/Articulate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,13 @@
<ItemGroup>
<PackageReference Include="Markdig" Version="0.31.0" />
<PackageReference Include="Argotic.Core" Version="3000.0.3" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.9" />
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="10.8.6" />
<PackageReference Include="Umbraco.Cms.Web.Website" Version="10.6.1" />
<PackageReference Include="Umbraco.Cms.Core" Version="10.8.6" />
<PackageReference Include="MessagePack" Version="2.5.187" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.9" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.11" />
<PackageReference Include="Smidge" Version="4.6.0" />
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="10.8.9" />
<PackageReference Include="Umbraco.Cms.Web.Website" Version="10.8.9" />
<PackageReference Include="Umbraco.Cms.Core" Version="10.8.9" />
<PackageReference Include="System.ServiceModel.Syndication" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.Abstractions" Version="6.0.14" />
<PackageReference Include="WilderMinds.MetaWeblog" Version="5.1.1" />
Expand Down
24 changes: 24 additions & 0 deletions src/Articulate/Articulate.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.2.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Articulate", "Articulate.csproj", "{4898C085-C261-A70F-895D-3598F88DB41E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4898C085-C261-A70F-895D-3598F88DB41E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4898C085-C261-A70F-895D-3598F88DB41E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4898C085-C261-A70F-895D-3598F88DB41E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4898C085-C261-A70F-895D-3598F88DB41E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {18BC7AC8-A037-4A87-B19B-FA1D999AD072}
EndGlobalSection
EndGlobal
Loading