mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
appveyor: publish self-contained
This commit is contained in:
parent
499a0abe7f
commit
bc3dfd4a73
3 changed files with 17 additions and 19 deletions
|
|
@ -94,8 +94,4 @@
|
||||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||||
<Exec Command="taskkill /f /fi "IMAGENAME eq Flow.Launcher.exe"" />
|
<Exec Command="taskkill /f /fi "IMAGENAME eq Flow.Launcher.exe"" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
|
||||||
<Exec Command="powershell.exe -NoProfile -ExecutionPolicy Bypass -File $(SolutionDir)Scripts\post_build.ps1 $(ConfigurationName) $(SolutionDir) $(TargetPath)" />
|
|
||||||
</Target>
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
param(
|
param(
|
||||||
[string]$config = "Release",
|
[string]$config = "Release",
|
||||||
[string]$solution,
|
[string]$solution = (Join-Path $PSScriptRoot ".." -Resolve)
|
||||||
[string]$targetpath
|
|
||||||
)
|
)
|
||||||
Write-Host "Config: $config"
|
Write-Host "Config: $config"
|
||||||
|
|
||||||
function Build-Version {
|
function Build-Version {
|
||||||
if ([string]::IsNullOrEmpty($env:flowVersion)) {
|
if ([string]::IsNullOrEmpty($env:flowVersion)) {
|
||||||
$v = (Get-Command ${TargetPath}).FileVersionInfo.FileVersion
|
$targetPath = Join-Path $solution "Output/Release/Flow.Launcher.dll" -Resolve
|
||||||
|
$v = (Get-Command ${targetPath}).FileVersionInfo.FileVersion
|
||||||
} else {
|
} else {
|
||||||
$v = $env:flowVersion
|
$v = $env:flowVersion
|
||||||
}
|
}
|
||||||
|
|
@ -75,6 +75,8 @@ function Pack-Squirrel-Installer ($path, $version, $output) {
|
||||||
|
|
||||||
Write-Host "Packing: $spec"
|
Write-Host "Packing: $spec"
|
||||||
Write-Host "Input path: $input"
|
Write-Host "Input path: $input"
|
||||||
|
# making version static as multiple versions can exist in the nuget folder and in the case a breaking change is introduced.
|
||||||
|
New-Alias Nuget $env:USERPROFILE\.nuget\packages\NuGet.CommandLine\5.4.0\tools\NuGet.exe -Force
|
||||||
# TODO: can we use dotnet pack here?
|
# TODO: can we use dotnet pack here?
|
||||||
nuget pack $spec -Version $version -BasePath $input -OutputDirectory $output -Properties Configuration=Release
|
nuget pack $spec -Version $version -BasePath $input -OutputDirectory $output -Properties Configuration=Release
|
||||||
|
|
||||||
|
|
@ -100,13 +102,14 @@ function Pack-Squirrel-Installer ($path, $version, $output) {
|
||||||
Write-Host "End pack squirrel installer"
|
Write-Host "End pack squirrel installer"
|
||||||
}
|
}
|
||||||
|
|
||||||
function IsDotNetCoreAppSelfContainedPublishEvent{
|
function Publish-Self-Contained ($p) {
|
||||||
return Test-Path $solution\Output\Release\coreclr.dll
|
|
||||||
}
|
|
||||||
|
|
||||||
function FixPublishLastWriteDateTimeError ($solutionPath) {
|
$csproj = Join-Path "$p" "Flow.Launcher/Flow.Launcher.csproj" -Resolve
|
||||||
#Fix error from publishing self contained app, when nuget tries to pack core dll references throws the error 'The DateTimeOffset specified cannot be converted into a Zip file timestamp'
|
$profile = Join-Path "$p" "Flow.Launcher/Properties/PublishProfiles/NetCore3.1-SelfContained.pubxml" -Resolve
|
||||||
gci -path "$solutionPath\Output\Release" -rec -file *.dll | Where-Object {$_.LastWriteTime -lt (Get-Date).AddYears(-20)} | % { try { $_.LastWriteTime = '01/01/2000 00:00:00' } catch {} }
|
|
||||||
|
# we call dotnet publish on the main project.
|
||||||
|
# The other projects should have been built in Release at this point.
|
||||||
|
dotnet publish -c Release $csproj /p:PublishProfile=$profile
|
||||||
}
|
}
|
||||||
|
|
||||||
function Main {
|
function Main {
|
||||||
|
|
@ -116,15 +119,12 @@ function Main {
|
||||||
|
|
||||||
if ($config -eq "Release"){
|
if ($config -eq "Release"){
|
||||||
|
|
||||||
if(IsDotNetCoreAppSelfContainedPublishEvent) {
|
|
||||||
FixPublishLastWriteDateTimeError $p
|
|
||||||
}
|
|
||||||
|
|
||||||
Delete-Unused $p $config
|
Delete-Unused $p $config
|
||||||
|
|
||||||
|
Publish-Self-Contained $p
|
||||||
|
|
||||||
$o = "$p\Output\Packages"
|
$o = "$p\Output\Packages"
|
||||||
Validate-Directory $o
|
Validate-Directory $o
|
||||||
# making version static as multiple versions can exist in the nuget folder and in the case a breaking change is introduced.
|
|
||||||
New-Alias Nuget $env:USERPROFILE\.nuget\packages\NuGet.CommandLine\5.4.0\tools\NuGet.exe -Force
|
|
||||||
Pack-Squirrel-Installer $p $v $o
|
Pack-Squirrel-Installer $p $v $o
|
||||||
|
|
||||||
$isInCI = $env:APPVEYOR
|
$isInCI = $env:APPVEYOR
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ before_build:
|
||||||
build:
|
build:
|
||||||
project: Flow.Launcher.sln
|
project: Flow.Launcher.sln
|
||||||
verbosity: minimal
|
verbosity: minimal
|
||||||
|
after_build:
|
||||||
|
- ps: .\Scripts\post_build.ps1
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: 'Output\Packages\Flow-Launcher-*.zip'
|
- path: 'Output\Packages\Flow-Launcher-*.zip'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue