-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sample console app with cross-plat building (host sys = mac)
- Loading branch information
Showing
4 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
appcast-output/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
outputDir="appcast-output" | ||
rm -rf "${outputDir}" # remove any old files | ||
mkdir -p $outputDir | ||
for config in "osx-arm64" "osx-x64" "win-arm64" "win-x64" "linux-x64"; do | ||
if [[ "$config" == osx* ]]; then | ||
ext="" | ||
if [[ "$config" == "osx-arm64" ]]; then | ||
os="macos-arm64" | ||
version=2.0 # since app cast gen doesn't like items with same version right now | ||
else | ||
os="macos-x64" | ||
version=2.1 | ||
fi | ||
aot="true" | ||
singlefile="false" | ||
elif [[ "$config" == win* ]]; then | ||
ext=".exe" | ||
if [[ "$config" == "win-arm64" ]]; then | ||
os="windows-arm64" | ||
version=2.2 | ||
else | ||
os="windows-x64" | ||
version=2.3 | ||
fi | ||
aot="false" | ||
singlefile="true" | ||
else | ||
ext="" | ||
version=2.4 | ||
os="linux-x64" | ||
aot="false" | ||
singlefile="true" | ||
fi | ||
filename="${outputDir}/${config}/SimpleNetSparkleConsoleApp${ext}" | ||
filenameNxt="${outputDir}/${config}/SimpleNetSparkleConsoleApp_${os}${ext}" | ||
dotnet publish -c Release --self-contained -r "${config}" -o "${outputDir}/${config}" "-p:PublishAot=${aot}" "-p:PublishSingleFile=${singlefile}" | ||
mv "${filename}" "${filenameNxt}" | ||
netsparkle-generate-appcast -n "Sparkle Console App" --os "${os}" --appcast-output-directory "${outputDir}" --single-file "${filenameNxt}" --reparse-existing --file-version "${version}" -u "https://netsparkleupdater.github.io/NetSparkle/files/console-sample-app" | ||
mv "${filenameNxt}" "${outputDir}/SimpleNetSparkleConsoleApp_${os}${ext}" | ||
done |
33 changes: 33 additions & 0 deletions
33
src/NetSparkle.Samples.SimpleConsoleApp/NetSparkle.Samples.SimpleConsoleApp.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<IsTrimmable>true</IsTrimmable> | ||
<PublishTrimmed>true</PublishTrimmed> | ||
<!-- <PublishSingleFile>true</PublishSingleFile> --> | ||
<TrimMode>full</TrimMode> | ||
<IsAotCompatible>true</IsAotCompatible> | ||
<Nullable>enable</Nullable> | ||
<!-- <PublishAot>true</PublishAot> --> | ||
<IlcOptimizationPreference>Size</IlcOptimizationPreference> | ||
<IlcFoldIdenticalMethodBodies>true</IlcFoldIdenticalMethodBodies> | ||
<IlcTrimMetadata>true</IlcTrimMetadata> | ||
<IlcDisableReflection>true</IlcDisableReflection> | ||
<IlcGenerateStackTraceData>false</IlcGenerateStackTraceData> | ||
|
||
<Version>1.0</Version> | ||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion> | ||
<AssemblyTitle>My Simple Console App - NetSparkle</AssemblyTitle> | ||
<AssemblyName>SimpleNetSparkleConsoleApp</AssemblyName> | ||
<Copyright>NetSparkleUpdater</Copyright> | ||
<Company>NetSparkleUpdater</Company> | ||
<Product>NetSparkleUpdater</Product> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)'=='Release'"> | ||
<DebugSymbols>False</DebugSymbols> | ||
<DebugType>None</DebugType> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Console.WriteLine(""); | ||
Console.WriteLine(""); | ||
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); | ||
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); | ||
Console.WriteLine("~~~~~~~~~~~~~~~~~ NetSparkle ~~~~~~~~~~~~~~~~~~~~~~~"); | ||
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); | ||
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); | ||
Console.WriteLine("Hello, World! This is the app downloaded by NetSparkle — usually the downloaded file would be your installer or DMG or other app you need for your updates~"); | ||
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); | ||
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); | ||
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); | ||
Console.WriteLine(""); | ||
Console.WriteLine(""); |