Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Sep 20, 2023
1 parent 4c2b046 commit d963396
Show file tree
Hide file tree
Showing 39 changed files with 2,241 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish

on:
push:
branches: [ master ]
paths:
- '.github/workflows/publish.yml'
- 'src/**'
- 'build/**'

env:
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending .NET CLI telemetry to Microsoft.
DOTNET_CLI_TELEMETRY_OPTOUT: true

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Setup
uses: butr/actions-common-setup@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}

- name: Run _build
run: >-
dotnet pack src/BUTR.CrashReport/BUTR.CrashReport.csproj --configuration Release -o "./packages";
dotnet pack src/BUTR.CrashReport.Bannerlord.Source/BUTR.CrashReport.Bannerlord.Source.csproj --configuration Release -o "./packages";
shell: pwsh

- name: Push to NuGet
run: dotnet nuget push "./packages/*.nupkg" -k ${{secrets.NUGET_API_KEY}} -s https://www.nuget.org
shell: pwsh

- name: Push to GPR
run: |
for f in ./packages/*.nupkg
do
curl -vX PUT -u "vslee:${{secrets.GITHUB_TOKEN}}" -F package=@$f https://nuget.pkg.github.com/BUTR/
done
shell: bash
Binary file added assets/Icon128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions build/common.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!--EXTERNAL_PROPERTIES: GITHUB_RUN_NUMBER;GITHUB_ACTIONS;MSBuildThisFileDirectory;TargetFramework-->
<Project>

<!--Development Variables-->
<PropertyGroup>
<GITHUB_RUN_NUMBER Condition="$(GITHUB_RUN_NUMBER) == ''">0</GITHUB_RUN_NUMBER>
<Version>1.0.0.$(GITHUB_RUN_NUMBER)</Version>
<LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable>

<Authors>BUTR Team</Authors>
<Owners>BUTR</Owners>

<DefineConstants>$(DefineConstants);BUTRCRASHREPORT_ENABLEWARNINGS;</DefineConstants>

<NoWarn>$(NoWarn);NU1701</NoWarn>
</PropertyGroup>

<!--GitHub Actions-->
<PropertyGroup Condition="$(GITHUB_ACTIONS) != 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<!--NuGet SorceLink-->
<PropertyGroup>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>false</IncludeSymbols>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<!--SorceLink-->
<PropertyGroup>
<Deterministic>true</Deterministic>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
<!--SorceLink-->
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>
<!--CI Builds-->
<ItemGroup Condition="$(TargetFramework) == 'net472' AND $(OS) != 'Windows_NT'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
13 changes: 13 additions & 0 deletions src/BUTR.CrashReport.Bannerlord.Source.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project>

<!--
Hide content files from Visual Studio solution explorer. Adapted from:
https://til.cazzulino.com/dotnet/nuget/hide-contentfiles-from-your-nuget-packages
-->
<ItemGroup>
<Compile Update="@(Compile)">
<Visible Condition="'%(NuGetItemType)' == 'Compile' and '%(NuGetPackageId)' == 'BUTR.CrashReport.Bannerlord.Source'">false</Visible>
</Compile>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>true</IsPackable>
</PropertyGroup>

<PropertyGroup>
<PackageId>BUTR.CrashReport.Bannerlord.Source</PackageId>
<Title>BUTR.CrashReport.Bannerlord.Source</Title>
<Description>.</Description>
<DevelopmentDependency>true</DevelopmentDependency>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>icon.png</PackageIcon>
<PackageIconUrl>https://raw.githubusercontent.com/BUTR/BUTR.CrashReport/master/assets/Icon128x128.png</PackageIconUrl>
<PackageTags>butr crash report bannerlord</PackageTags>
</PropertyGroup>

<!--NuGetizer-->
<PropertyGroup>
<BuildProjectReferences>false</BuildProjectReferences>
<BuildOnPack>false</BuildOnPack>
<PackOnBuild>false</PackOnBuild>
<PackBuildOutput>false</PackBuildOutput>
<PackSymbols>false</PackSymbols>
<PackCompile>false</PackCompile>
<PackEmbeddedResource>true</PackEmbeddedResource>
<PackDependencies>false</PackDependencies>
<PackProjectReferences>false</PackProjectReferences>
<EnablePackCleanup>true</EnablePackCleanup>
<EnablePackInference>true</EnablePackInference>

<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">obj</BaseIntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<PackageFile Include="**/*.cs" PackagePath="content\cs\$(TargetFramework)\$(ProjectName)\%(RelativeDir)%(Filename).cs" Exclude="$(BaseIntermediateOutputPath)/**/*.cs" />
<PackageFile Include="**/*.cs" PackagePath="contentFiles\cs\$(TargetFramework)\$(ProjectName)\%(RelativeDir)%(Filename).cs" Exclude="$(BaseIntermediateOutputPath)/**/*.cs" />
<PackageFile Include="../BUTR.CrashReport.Bannerlord.Source.props" PackagePath="build/BUTR.CrashReport.Bannerlord.Source.props" />
<PackageFile Include="../../assets/Icon128x128.png" PackagePath="icon.png" />
<PackageFile Include="BUTR.CrashReport" Version="$(Version)" PackFolder="Dependency" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NuGetizer" Version="1.1.1" Pack="false" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Ben.Demystifier" Version="0.4.1" Pack="true" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Harmony.Extensions" Version="3.2.0.77" Pack="true" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="Lib.Harmony" Version="2.2.2" Pack="true" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bannerlord.ReferenceAssemblies.Core" Version="1.0.0.*-*" Pack="false" PrivateAssets="all" />
<PackageReference Include="Bannerlord.ModuleManager.Source" Version="5.0.209" Pack="true" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="Bannerlord.BUTR.Shared" Version="3.0.0.137" Pack="true" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BUTR.CrashReport\BUTR.CrashReport.csproj" Pack="true" />
</ItemGroup>

</Project>
Loading

0 comments on commit d963396

Please sign in to comment.