From ecdf4827a27df29f37d8d8a8d728f86c41782d67 Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Sat, 31 Jul 2021 13:14:10 -0500 Subject: [PATCH] fix: include all files in zip after dotnet publish This is only required because LibGit2Sharp bundles PDB files in its nuget package. See the following github issues for more info. - https://github.com/dotnet/runtime/issues/3807 - https://github.com/libgit2/libgit2sharp.nativebinaries/issues/111 --- CHANGELOG.md | 4 ++++ ci/PublishAndZip.ps1 | 23 ++++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f997905c..04bbd0b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### FIXED + +- Fix "assembly not found" error on startup related to LibGit2Sharp. + ## [1.6.2] - 2021-07-23 ### Fixed diff --git a/ci/PublishAndZip.ps1 b/ci/PublishAndZip.ps1 index a63f7fb2..31cbaf61 100644 --- a/ci/PublishAndZip.ps1 +++ b/ci/PublishAndZip.ps1 @@ -1,8 +1,7 @@ [CmdletBinding()] param ( - [Parameter(Mandatory=$true)] - [string] - $runtime + [Parameter(Mandatory = $true)] + [string] $runtime ) $ErrorActionPreference = "Stop" @@ -15,7 +14,21 @@ dotnet publish src\Trash ` -p:PublishSingleFile=true ` -p:PublishTrimmed=true ` -p:IncludeNativeLibrariesForSelfExtract=true ` - -p:PublishReadyToRun=true + -p:PublishReadyToRun=true ` + -p:PublishReadyToRunShowWarnings=true +if (Get-Command chmod) { + "The chmod command was found. Setting read + execute permission." + & chmod +rx ./publish/$runtime/trash +} + +"Execute trash command to ensure basic functionality is working" +& .\publish\$runtime\trash -h +if ($LASTEXITCODE -ne 0) { + "Trash executable failed to run with exit code: $LASTEXITCODE" + exit -1 +} + +"Zip the published files" New-Item -ItemType Directory -Force -Path publish\zip -Compress-Archive publish\$runtime\trash* publish\zip\trash-$runtime.zip -Force +Compress-Archive publish\$runtime\* publish\zip\trash-$runtime.zip -Force