aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yml2
-rwxr-xr-xbin/build15
-rwxr-xr-xbin/publish4
-rw-r--r--src/slskd/Program.cs36
-rw-r--r--src/slskd/slskd.csproj14
5 files changed, 63 insertions, 8 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 57bef316..f7307efc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -34,7 +34,7 @@ jobs:
name: web
path: src/slskd/wwwroot
- name: Publish ${{ matrix.runtime }}
- run: bin/publish --no-build --runtime ${{ matrix.runtime }} --version-suffix $(echo $GITHUB_SHA | cut -c1-8)
+ run: bin/publish --no-prebuild --runtime ${{ matrix.runtime }} --version-suffix $(echo $GITHUB_SHA | cut -c1-8)
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
diff --git a/bin/build b/bin/build
index 23eaa5d0..b07b08a9 100755
--- a/bin/build
+++ b/bin/build
@@ -3,14 +3,16 @@ set -e
web_only=false
skip_tests=false
+version_suffix=$(git rev-parse --short HEAD)
while test $# -gt 0; do
case "$1" in
-h|--help)
echo 'options:'
- echo '-h, --help show help'
- echo '--web-only skip dotnet build'
- echo '--skip-tests skip execution of npm and dotnet tests'
+ echo '-h, --help show help'
+ echo '--web-only skip dotnet build'
+ echo '--skip-tests skip execution of npm and dotnet tests'
+ echo '--version-suffix version suffix for the binary. defaults to current git SHA'
exit 0
;;
--web-only)
@@ -21,6 +23,11 @@ while test $# -gt 0; do
skip_tests=true
shift
;;
+ --version-suffix)
+ shift
+ version_suffix=$1
+ shift
+ ;;
*)
break
;;
@@ -65,7 +72,7 @@ else
pwd
echo $'\n> dotnet build --no-incremental --nologo --configuration Release\n'
- dotnet build --no-incremental --nologo --configuration Release
+ dotnet build --no-incremental --nologo --configuration Release --version-suffix $version_suffix
if [ "$skip_tests" == false ]; then
echo $'\n> dotnet test --configuration Release ../../tests/slskd.Tests.Unit'
diff --git a/bin/publish b/bin/publish
index 9f0194ef..106ed392 100755
--- a/bin/publish
+++ b/bin/publish
@@ -9,12 +9,12 @@ while test $# -gt 0; do
-h|--help)
echo 'options:'
echo '-h, --help show help'
- echo '--no-build skip build'
+ echo '--no-prebuild skip build'
echo '--version-suffix version suffix for the binary. defaults to current git SHA'
echo '--runtine a valid RID (https://docs.microsoft.com/en-us/dotnet/core/rid-catalog)'
exit 0
;;
- --no-build)
+ --no-prebuild)
build=false
shift
;;
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index a9553bd8..814cd15c 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -4,11 +4,26 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
+ using System;
+ using System.Linq;
+ using System.Reflection;
public class Program
{
public static void Main(string[] args)
{
+ var assembly = Assembly.GetExecutingAssembly();
+ var assemblyVersion = assembly.GetName().Version;
+ var informationVersion = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
+ var version = $"{assemblyVersion} ({informationVersion})";
+
+ if (args.Any(a => a == "--version" || a == "-v"))
+ {
+ Console.WriteLine(version);
+ return;
+ }
+
+ PrintBanner(version);
CreateWebHostBuilder(args).Build().Run();
}
@@ -27,5 +42,26 @@
}
})
.UseStartup<Startup>();
+
+ public static void PrintBanner(string version)
+ {
+ var banner = @$"
+ oooo oooo .o8
+ `888 `888 '888
+ .oooo.o 888 .oooo.o 888 oooo .oooo888
+ d88( '8 888 d88( '8 888 .8P' d88' `888
+ `'Y88b. 888 `'Y88b. 888888. 888 888
+ o. )88b 888 o. )88b 888 `88b. 888 888
+ 8''888P' o888o 8''888P' o888o o888o `Y8bod88P
+╒═══════════════════════════════════════════════╕
+│ GNU AFFERO GENERAL PUBLIC LICENSE │
+│ slskd.org │
+│ │
+│ {version} │
+└───────────────────────────────────────────────┘
+ ";
+
+ Console.WriteLine(banner);
+ }
}
}
diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj
index 14c2ad94..3415ba18 100644
--- a/src/slskd/slskd.csproj
+++ b/src/slskd/slskd.csproj
@@ -7,7 +7,12 @@
<PropertyGroup>
<ServerGarbageCollection>false</ServerGarbageCollection>
- <VersionPrefix>0.0.1</VersionPrefix>
+ <VersionPrefix>0.9.1</VersionPrefix>
+ <RepositoryUrl>https://github.com/slskd/slskd</RepositoryUrl>
+ <PackageProjectUrl>https://slskd.org</PackageProjectUrl>
+ <Authors>slskd Team</Authors>
+ <Copyright>Copyright (c) slskd Team</Copyright>
+ <PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -39,4 +44,11 @@
</Content>
</ItemGroup>
+ <ItemGroup>
+ <None Include="..\..\LICENSE">
+ <Pack>True</Pack>
+ <PackagePath></PackagePath>
+ </None>
+ </ItemGroup>
+
</Project>