Skip to content

Commit

Permalink
Add some publishing stuff for an exe
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJoeFin committed Dec 17, 2023
1 parent 9a9fb56 commit 1700d23
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ProjectOtter/ProjectOtter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<Nullable>enable</Nullable>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
<PublishSingleFile>true</PublishSingleFile>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
</PropertyGroup>

Expand All @@ -32,6 +33,15 @@
<ItemGroup>
<ProjectReference Include="..\ProjectOtter.Core\ProjectOtter.Core.csproj" />
</ItemGroup>

<ItemGroup>
<Content Update="Assets\StoreLogo.scale-400.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="Assets\WindowIcon.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down
25 changes: 25 additions & 0 deletions ProjectOtter/buildUnPackaged.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
$BuildPath = "$PSScriptRoot\bld\x64"
$BuildPathSC = "$PSScriptRoot\bld\x64\Project-Otter-Self-Contained"
$Version = Get-Date -Format "yyyy-MM-dd" # 2020-11-1
$VersionDot = $Version -replace '-','.'
$Project = "ProjectOtter"
$Archive = "$BuildPath\$Project-$Version.zip"
$ArchiveSC = "$BuildPath\$Project-Self-Contained-$Version.zip"

# Clean up
if(Test-Path -Path $BuildPath)
{
Remove-Item $BuildPath -Recurse
}

# Dotnet restore and build
dotnet publish `
--runtime win-x64 `
--self-contained false `
-c Release `
-v minimal `
-p:Platform=x64 `
-p:PublishReadyToRun=true `
-p:PublishSingleFile=true `
-p:Version=$VersionDot `

0 comments on commit 1700d23

Please sign in to comment.