SmartBear-DevRel / explore-cli

Simple utility CLI for importing and exporting data to and from SwaggerHub Explore
https://www.nuget.org/packages/Explore.Cli
Apache License 2.0
5 stars 4 forks source link

feat: Dotnet non-dependant executables #28

Closed YOU54F closed 6 months ago

YOU54F commented 6 months ago

fixes #24

Yak Shave

Oddly the publish command fails, but the apps work fine. Setting UseAppHost to true results in more files than we need and unnecessarily binds the executable to Explore.Cli.Dll which we don't want.

the above true condition is a yak shave, 
/usr/local/share/dotnet/sdk/7.0.409/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(111,5): 
error NETSDK1098: Applications published to a single-file are required to use the application host. 
You must either set PublishSingleFile to false or set UseAppHost to true.

I think it is this bug

https://github.com/dotnet/runtime/discussions/79948

We are mitigating the fact that the job can pass with an app that has actually failed to build, by testing each of the output executables on end user machines (with exception to win-arm64 as we have no CI capabilities afforded by GH), which if these fail, will block the release

Linux

Caveats for linux users.

(can be mitigated by move to .NET 8 - ref to static linking)

Requirements

Alpine

apk add gcc icu

Debian

apt update && apt install -y libicu

MacOS

Dynamically linked to only system libraries

X64

bin/hello_dotnet-osx-x64/Explore.Cli:
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
        /System/Library/Frameworks/GSS.framework/Versions/A/GSS (compatibility version 1.0.0, current version 1.0.0)
        /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1856.105.0)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1856.105.0)
        /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 60157.60.19)
        /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1141.1.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1200.3.0)
        /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

ARM64

bin/hello_dotnet-osx-arm64/Explore.Cli:
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
        /System/Library/Frameworks/GSS.framework/Versions/A/GSS (compatibility version 1.0.0, current version 1.0.0)
        /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1856.105.0)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1856.105.0)
        /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 60157.60.19)
        /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1141.1.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1200.3.0)
        /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

Windows

X64

Tested on MacOS M1 with Parallels Windows Instance

ARM64

Tested on MacOS M1 with Parallels Windows Instance

YOU54F commented 6 months ago

Elected for releases on workflow_dispatch using the generated MajorMinorPatch version from the git commit step which should keep in lock step with the manual dispatches done for NuGet.

We can improve on that in a later interation.

Will publish gzipped files, with shasums to gh releases under tag example 0.5.0

YOU54F commented 6 months ago

Full publish wf on fork, triggered by workflow_dispatch - https://github.com/YOU54F/explore-cli/actions/runs/9191667420

GH release on fork - https://github.com/YOU54F/explore-cli/releases/tag/0.5.0