Include git sha in binary
This commit is contained in:
parent
7238e7177d
commit
59ee6b289a
6 changed files with 15 additions and 6 deletions
|
@ -22,7 +22,7 @@ build:
|
|||
script:
|
||||
- dotnet restore
|
||||
- dotnet test Tests
|
||||
- dotnet publish --configuration Release -o Binaries ./
|
||||
- dotnet publish --version-suffix ${CI_COMMIT_SHA:0:8} --configuration Release -o Binaries ./
|
||||
|
||||
deploy:
|
||||
stage: deploy
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace Geekbot.net.Commands.Utils
|
|||
|
||||
eb.WithAuthor(new EmbedAuthorBuilder()
|
||||
.WithIconUrl(_client.CurrentUser.GetAvatarUrl())
|
||||
.WithName($"{Constants.Name} V{Constants.BotVersion}"));
|
||||
.WithName($"{Constants.Name} V{Constants.BotVersion()}"));
|
||||
var botOwner = await Context.Guild.GetUserAsync(ulong.Parse(_redis.StringGet("botOwner")));
|
||||
var uptime = DateTime.Now.Subtract(Process.GetCurrentProcess().StartTime);
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<ApplicationIcon>derp.ico</ApplicationIcon>
|
||||
<Version>3.7.0</Version>
|
||||
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
|
||||
<Version Condition=" '$(VersionSuffix)' != '' ">$(Version)-$(VersionSuffix)</Version>
|
||||
<Company>Pizza and Coffee Studios</Company>
|
||||
<Authors>Pizza and Coffee Studios</Authors>
|
||||
<Description>A Discord bot</Description>
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
namespace Geekbot.net.Lib
|
||||
using System.Reflection;
|
||||
|
||||
namespace Geekbot.net.Lib
|
||||
{
|
||||
public class Constants
|
||||
{
|
||||
public const string Name = "Geekbot";
|
||||
public const double BotVersion = 3.7;
|
||||
|
||||
public static string BotVersion()
|
||||
{
|
||||
return typeof(Program).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
|
||||
}
|
||||
|
||||
public const double ApiVersion = 1;
|
||||
}
|
||||
}
|
|
@ -25,7 +25,7 @@ namespace Geekbot.net.Lib.ErrorHandling
|
|||
var sentryDsn = Environment.GetEnvironmentVariable("SENTRY");
|
||||
if (!string.IsNullOrEmpty(sentryDsn))
|
||||
{
|
||||
_raven = new RavenClient(sentryDsn);
|
||||
_raven = new RavenClient(sentryDsn) { Release = Constants.BotVersion() };
|
||||
_logger.Information(LogSource.Geekbot, $"Command Errors will be logged to Sentry: {sentryDsn}");
|
||||
}
|
||||
else
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Geekbot.net.WebApi.Status
|
|||
{
|
||||
var responseBody = new ApiStatusDto
|
||||
{
|
||||
GeekbotVersion = Constants.BotVersion.ToString(),
|
||||
GeekbotVersion = Constants.BotVersion(),
|
||||
ApiVersion = Constants.ApiVersion.ToString(),
|
||||
Status = "Online"
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue