Skip to content

Commit

Permalink
Merge pull request #101 from BUTR/dev
Browse files Browse the repository at this point in the history
v1.5.0
  • Loading branch information
Aragas committed Apr 29, 2024
2 parents a3799da + cccf523 commit c166cb0
Show file tree
Hide file tree
Showing 119 changed files with 7,983 additions and 7,664 deletions.
30 changes: 1 addition & 29 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1 @@
FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu-20.04

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
wget \
ca-certificates \
\
# .NET dependencies
libc6 \
libgcc1 \
libgssapi-krb5-2 \
libicu66 \
libssl1.1 \
libstdc++6 \
zlib1g \
\
# Mono
mono-devel \
# Install Microsoft package feed
&& wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
\
# Install .NET 6 & 7
&& apt-get update \
&& apt-get install -y --no-install-recommends \
dotnet-sdk-6.0 \
dotnet-sdk-7.0 \
&& rm -rf /var/lib/apt/lists/*
FROM ghcr.io/butr/devcontainer:latest
76 changes: 72 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,79 @@
{
"name": ".NET Core & Mono",
"name": ".NET & Mono & Powershell",
"build": {
"dockerfile": "Dockerfile"
"dockerfile": "Dockerfile",
"cacheFrom": [
"ghcr.io/butr/bannerlord.blse-devcontainer:latest"
]
},
"features": {
"ghcr.io/butr/devcontainer/upgrade:1": {

},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
},
"ghcr.io/butr/devcontainer/mono:1": {

},
"ghcr.io/devcontainers/features/dotnet:2": {

},
"ghcr.io/devcontainers/features/powershell:1": {
"version": "latest"
"version": "latest"
}
},
"overrideFeatureInstallOrder": [
"ghcr.io/butr/devcontainer/upgrade",
"ghcr.io/devcontainers/features/git",
"ghcr.io/butr/devcontainer/mono",
"ghcr.io/devcontainers/features/dotnet",
"ghcr.io/devcontainers/features/powershell",
],
"containerEnv": {
"DOTNET_CLI_TELEMETRY_OPTOUT": "true",
"DOTNET_HTTPREPL_TELEMETRY_OPTOUT": "true",
"DOTNET_NOLOGO": "true",
"DOTNET_SKIP_FIRST_TIME_EXPERIENCE": "true",
"DOTNET_USE_POLLING_FILE_WATCHER": "true",
"NUGET_XMLDOC_MODE": "skip",

"BANNERLORD_BUTR_COMPATIBILITY_SCORE_URL": "${localEnv:BANNERLORD_BUTR_COMPATIBILITY_SCORE_URL}"
},
"mounts": [
{
"source":"${localEnv:BANNERLORD_GAME_DIR}",
"target":"/bannerlord",
"type":"bind"
}
],
"postStartCommand": {
"dotnet restore": "dotnet restore src/Bannerlord.BLSE.sln"
},
"postAttachCommand": "dotnet restore src/Bannerlord.BLSE.sln",
"customizations": {
"vscode": {
"extensions": [
"editorconfig.editorconfig",
"github.vscode-github-actions",
"ms-vscode.powershell",
"ms-azuretools.vscode-docker",
"ms-dotnettools.csdevkit"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "pwsh",
"terminal.integrated.profiles.linux": {
"path": {
"path": "/usr/local/bin/pwsh"
}
},
"powershell.powerShellAdditionalExePaths": {
"pwsh": "/usr/local/bin/pwsh"
},
"telemetry.telemetryLevel": "off",
"dotnetAcquisitionExtension.enableTelemetry": false
}
}
}
}
}
33 changes: 33 additions & 0 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Dev Container Build and Push Image

on:
workflow_dispatch:
push:
branches:
- master
paths:
- '.devcontainer/**/*'
- '.github/workflows/devcontainer.yml'

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
-
name: Checkout
id: checkout
uses: actions/checkout@v4
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: BUTR
password: ${{ secrets.TOKEN_GPR }}
-
name: Pre-build dev container image
uses: devcontainers/ci@v0.3
with:
imageName: ghcr.io/butr/bannerlord.blse-devcontainer
cacheFrom: ghcr.io/butr/bannerlord.blse-devcontainer
push: always
14 changes: 7 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ jobs:
###########################
publish-on-nexusmods:
if: github.ref == 'refs/heads/master'
needs: ["get-changelog", "build"]
needs: [get-changelog, build]
uses: BUTR/workflows/.github/workflows/release-nexusmods.yml@master
with:
nexusmods_game_id: mountandblade2bannerlord
nexusmods_mod_id: 1
mod_filename: 'Bannerlord Software Extender (BLSE)'
mod_version: ${{ needs.build-changelog.outputs.mod_version }}
mod_version: ${{ needs.get-changelog.outputs.mod_version }}
mod_description: ${{ needs.build.outputs.mod_description }}
artifact_name: bannerlord
secrets:
Expand All @@ -94,11 +94,11 @@ jobs:
###########################
publish-on-github:
if: github.ref == 'refs/heads/master'
needs: ["get-changelog", "build"]
needs: [get-changelog, build]
uses: BUTR/workflows/.github/workflows/release-github.yml@master
with:
mod_id: Bannerlord.BLSE
mod_version: ${{ needs.build-changelog.outputs.mod_version }}
mod_version: ${{ needs.get-changelog.outputs.mod_version }}
mod_description: ${{ needs.build.outputs.mod_description }}
artifact_name: bannerlord

Expand All @@ -107,7 +107,7 @@ jobs:
###########################
publish-on-steam:
if: github.ref == 'refs/heads/master'
needs: ["get-changelog", "build"]
needs: [get-changelog, build]
runs-on: ubuntu-latest
steps:
- name: Download Module artifact
Expand All @@ -123,7 +123,7 @@ jobs:
ssfnFileName: ${{ secrets.STEAM_SSFN_FILE_NAME }}
ssfnFileContents: ${{ secrets.STEAM_SSFN_FILE_CONTENTS }}
appId: ${{ secrets.STEAM_APPID }}
buildDescription: ${{ needs.build-changelog.outputs.mod_version }}
rootPath: artifact
buildDescription: ${{ needs.get-changelog.outputs.mod_version }}
rootPath: build
depot1Path: ./artifact
releaseBranch: prerelease
8 changes: 4 additions & 4 deletions build/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

<!--Development Variables-->
<PropertyGroup>
<Version>1.4.12</Version>
<Version>1.5.0</Version>
<HarmonyVersion>2.2.2</HarmonyVersion>
<BUTRSharedVersion>3.0.0.137</BUTRSharedVersion>
<BUTRModuleManagerVersion>5.0.209</BUTRModuleManagerVersion>
<BUTRSharedVersion>3.0.0.139</BUTRSharedVersion>
<BUTRModuleManagerVersion>5.0.222</BUTRModuleManagerVersion>
<HarmonyExtensionsVersion>3.2.0.77</HarmonyExtensionsVersion>
<HarmonyAnalyzerVersion>1.0.1.50</HarmonyAnalyzerVersion>
<LauncherManagerVersion>1.0.77</LauncherManagerVersion>
<LauncherManagerVersion>1.0.107</LauncherManagerVersion>
<DebugType>full</DebugType>
</PropertyGroup>

Expand Down
3 changes: 2 additions & 1 deletion build/common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ if (Files.Length > 0)
Log.LogMessage(MessageImportance.Normal, $"EmbeddedResource Src: {sourceItemSpec}");
using (var sourceStream = File.OpenRead(sourcePath))
using (var destinationStream = File.OpenWrite(destinationPath))
using (var destinationStream = new FileStream(destinationPath, FileMode.OpenOrCreate, FileAccess.Write))
using (var destinationGZip = new GZipStream(destinationStream, CompressionLevel.Optimal))
{
destinationStream.SetLength(0);
sourceStream.CopyTo(destinationGZip);
}
Expand Down
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
---------------------------------------------------------------------------------------------------
Version: 1.5.0
Game Versions: v1.0.0,v1.0.1,v1.0.2,v1.0.3,v1.1.0,v1.1.1,v1.1.2,v1.1.3,v1.1.4,v1.1.5,v1.1.6,v1.2.x
* BETA Release!
* Switched to new launcher manager backend
* Added Update Recommendations - based on BUTR Analytics Server (based on ButterLib Crash Reports)
---------------------------------------------------------------------------------------------------
Version: 1.4.12
Game Versions: v1.0.0,v1.0.1,v1.0.2,v1.0.3,v1.1.0,v1.1.1,v1.1.2,v1.1.3,v1.1.4,v1.1.5,v1.1.6,v1.2.9
* Adapted to v1.2.9. Thanks to jzebedee!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>winexe</OutputType>
<PlatformTarget>x64</PlatformTarget>
<TargetFramework>net472</TargetFramework>
<LangVersion>11.0</LangVersion>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<ApplicationIcon>../../resources/BLSE_SMALL.ico</ApplicationIcon>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>winexe</OutputType>
<PlatformTarget>x64</PlatformTarget>
<TargetFramework>net472</TargetFramework>
<LangVersion>11.0</LangVersion>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<ApplicationIcon>../../resources/BLSE_SMALL.ico</ApplicationIcon>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>winexe</OutputType>
<PlatformTarget>x64</PlatformTarget>
<TargetFramework>net472</TargetFramework>
<LangVersion>11.0</LangVersion>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<ApplicationIcon>../../resources/BLSE_SMALL.ico</ApplicationIcon>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
14 changes: 7 additions & 7 deletions src/Bannerlord.BLSE.Shared/Bannerlord.BLSE.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>11.0</LangVersion>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<PlatformTarget>x64</PlatformTarget>
<OutputType>library</OutputType>
Expand All @@ -18,13 +18,11 @@
<!-- No. No. LauncherExData is inaccessible due to its protection level. -->
<ILRepackPerformInternalize>false</ILRepackPerformInternalize>
<ILRepackCopyAttributes>true</ILRepackCopyAttributes>
<ILRepackBuildToolingPath>$(PkgBUTR_ILRepack)\tools\net461\ILRepack.exe</ILRepackBuildToolingPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ILRepack" Version="2.0.18" PrivateAssets="all" IncludeAssets="none" />
<PackageReference Include="BUTR.ILRepack" Version="2.1.9-beta7" GeneratePathProperty="true" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="ILRepack.FullAuto" Version="1.2.0" PrivateAssets="all" />
<PackageReference Include="ILRepack" Version="2.0.31" PrivateAssets="all" />
<PackageReference Include="ILRepack.FullAuto" Version="1.5.0" PrivateAssets="all" />

<PackageReference Include="Bannerlord.ReferenceAssemblies.Core" Version="$(GameVersion).*-*" IncludeAssets="compile" PrivateAssets="all" />

Expand Down Expand Up @@ -79,8 +77,10 @@
<LauncherExProject>$(MSBuildThisFileDirectory)..\Bannerlord.LauncherEx\Bannerlord.LauncherEx.csproj</LauncherExProject>
<LauncherExProjectFull>"$([System.IO.Path]::GetFullPath('$(LauncherExProject)'))"</LauncherExProjectFull>
</PropertyGroup>
<Message Text="dotnet build $(LauncherExProjectFull) --target:BuildExtended -p:GameVersion=%(GameAPIVersion.GameVersion) -p:Configuration=$(Configuration)_%(GameAPIVersion.Flat) -p:ILRepackBuildEnable=true" Importance="High" />
<Exec Command="dotnet build $(LauncherExProjectFull) --target:BuildExtended -p:GameVersion=%(GameAPIVersion.GameVersion) -p:Configuration=$(Configuration)_%(GameAPIVersion.Flat) -p:ILRepackBuildEnable=true" />
<Message Text="dotnet clean $(LauncherExProjectFull) -p:Configuration=$(Configuration)_%(GameAPIVersion.Flat)" Importance="High" />
<Exec Command="dotnet clean $(LauncherExProjectFull) -p:Configuration=$(Configuration)_%(GameAPIVersion.Flat)" />
<Message Text="dotnet build $(LauncherExProjectFull) -p:Configuration=$(Configuration)_%(GameAPIVersion.Flat) -p:GameVersion=%(GameAPIVersion.GameVersion)" Importance="High" />
<Exec Command="dotnet build $(LauncherExProjectFull) -p:Configuration=$(Configuration)_%(GameAPIVersion.Flat) -p:GameVersion=%(GameAPIVersion.GameVersion)" />
</Target>
<Target Condition="$(Configuration) == 'Release'" Name="BeforeBuildCompress" AfterTargets="BeforeBuildLauncherEx">
<GZip Files="@(EmbeddedResource)">
Expand Down
13 changes: 6 additions & 7 deletions src/Bannerlord.BLSE/BLSECommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
using System.Linq;
using System.Reflection;

namespace Bannerlord.BLSE
namespace Bannerlord.BLSE;

public static class BLSECommands
{
public static class BLSECommands
public static string GetVersion(List<string> _)
{
public static string GetVersion(List<string> _)
{
var blseMetadata = AccessTools2.TypeByName("Bannerlord.BLSE.BLSEInterceptorAttribute")?.Assembly.GetCustomAttributes<AssemblyMetadataAttribute>();
return blseMetadata?.FirstOrDefault(x => x.Key == "BLSEVersion")?.Value ?? "0.0.0.0";
}
var blseMetadata = AccessTools2.TypeByName("Bannerlord.BLSE.BLSEInterceptorAttribute")?.Assembly.GetCustomAttributes<AssemblyMetadataAttribute>();
return blseMetadata?.FirstOrDefault(x => x.Key == "BLSEVersion")?.Value ?? "0.0.0.0";
}
}
9 changes: 4 additions & 5 deletions src/Bannerlord.BLSE/BLSEExceptionHandlerAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;

namespace Bannerlord.BLSE
{
[AttributeUsage(AttributeTargets.Class)]
public sealed class BLSEExceptionHandlerAttribute : Attribute { }
}
namespace Bannerlord.BLSE;

[AttributeUsage(AttributeTargets.Class)]
public sealed class BLSEExceptionHandlerAttribute : Attribute { }
9 changes: 4 additions & 5 deletions src/Bannerlord.BLSE/BLSEInterceptorAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;

namespace Bannerlord.BLSE
{
[AttributeUsage(AttributeTargets.Class)]
public sealed class BLSEInterceptorAttribute : Attribute { }
}
namespace Bannerlord.BLSE;

[AttributeUsage(AttributeTargets.Class)]
public sealed class BLSEInterceptorAttribute : Attribute { }
2 changes: 1 addition & 1 deletion src/Bannerlord.BLSE/Bannerlord.BLSE.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Version>$(Version).$(GITHUB_RUN_NUMBER)</Version>

<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>11.0</LangVersion>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<PlatformTarget>x64</PlatformTarget>

Expand Down
Loading

0 comments on commit c166cb0

Please sign in to comment.