Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 24 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
name: Build on Push
name: Build

on:
push:
branches: [master]
pull_request:
push:
branches: [ master ]
# Trigger the workflow on any pull request
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
# Use checkout to publish the files in your repo
- name: Checkout
uses: actions/checkout@v4
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0

- name: Setup Dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: "9.x"
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.x"

- name: Restore and Build
run: |
dotnet restore
dotnet tool restore
dotnet build -c Release
- name: Restore
run: |
dotnet restore --locked-mode
dotnet tool restore

- name: Build
run: dotnet build -c Release
91 changes: 21 additions & 70 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,30 @@
name: 'Publish Package'
name: Publish

on:
push:
tags:
- '*'
tags: [ "*" ]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.x
9.x
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0

- name: Restore Dependencies
shell: bash
run: dotnet restore

- name: Restore Tools
shell: bash
run: dotnet tool restore

- name: Get Properties
id: get-properties
shell: bash
run: |
get-dotnet-property() {
local CSPROJ="./src/ShipInventoryUpdated/ShipInventoryUpdated.csproj"

for propertyName in "$@"
do
local VALUE=$(dotnet msbuild "$CSPROJ" --getProperty:"$propertyName")

if [ -n "$VALUE" ]; then
echo "$VALUE"
return 0
fi
done

echo ""
}

echo "NAME=$(get-dotnet-property 'Product')" >> $GITHUB_OUTPUT
echo "TEAM=$(get-dotnet-property 'Authors')" >> $GITHUB_OUTPUT
echo "DESCRIPTION=$(get-dotnet-property 'Description')" >> $GITHUB_OUTPUT
echo "WEBSITE=$(get-dotnet-property 'PackageProjectUrl' 'RepositoryUrl')" >> $GITHUB_OUTPUT

- uses: WarperSan/upload-thunderstore-package@v0.1.1-beta
with:
community: 'lethal-company'
team: ${{ steps.get-properties.outputs.TEAM }}
categories: |
mods
tweaks-and-quality-of-life
performance
furniture
name: ${{ steps.get-properties.outputs.NAME }}
description: ${{ steps.get-properties.outputs.DESCRIPTION }}
version: ${{ github.ref_name }}
dependencies: |
BepInEx-BepInExPack-5.4.2100
Evaisa-LethalLib-1.1.1
WhiteSpike-Interactive_Terminal_API-1.3.0
Sigurd-CSync-5.0.1
website: ${{ steps.get-properties.outputs.WEBSITE }}
files: |
./src/ShipInventoryUpdated/bin/Release/ShipInventoryUpdated.dll
./src/ShipInventoryUpdated/Resources/Localization/*.json
./src/ShipInventoryUpdated/Resources/Bundles/si-bundle
token: ${{ secrets.TCLI_AUTH_TOKEN }}
package-files: |
./icon.png
./README.md
./LICENSE
./CHANGELOG.md
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.x"

- name: Restore
run: |
dotnet restore --locked-mode
dotnet tool restore

- name: Publish to Thunderstore
env:
THUNDERSTORE_TOKEN: ${{ secrets.TCLI_AUTH_TOKEN }}
run: dotnet pack -c Release -p:PublishTS=true
5 changes: 0 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<Project>

<PropertyGroup>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>__PROJECT_URL__</RepositoryUrl>
</PropertyGroup>

<PropertyGroup>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
Expand Down
20 changes: 20 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project>
<Sdk Name="ThunderPipe.Sdk" Version="0.1.3"/>

<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
<PackageReference
Expand Down Expand Up @@ -40,4 +41,23 @@ namespace $(RootNamespace)

<WriteLinesToFile Lines="$(GeneratedText)" File="$(GeneratedFilePath)" WriteOnlyWhenDifferent="true" Overwrite="true"/>
</Target>

<Target Name="NetcodePatch" AfterTargets="PostBuildEvent">
<PropertyGroup>
<NetcodePatcherDepsListFile>$(IntermediateOutputPath)ncp-deps.list</NetcodePatcherDepsListFile>
</PropertyGroup>
<WriteLinesToFile File="$(NetcodePatcherDepsListFile)" Lines="@(ReferencePathWithRefAssemblies)" Overwrite="true"/>
<Exec Command="dotnet tool run netcode-patch -uv 2022.3.62 -nv 1.12.2 -tv 1.0.0 &quot;$(TargetPath)&quot; --dependency-file &quot;$(NetcodePatcherDepsListFile)&quot;"/>
</Target>

<Target Name="SetThunderstoreVersion" AfterTargets="MinVer">
<PropertyGroup>
<ThunderstoreVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch)</ThunderstoreVersion>
</PropertyGroup>
</Target>

<PropertyGroup>
<RunThunderPipePackAfterBuild Condition="'$(RunThunderPipePackAfterBuild)' != 'false' And '$(Configuration)' == 'Release'">true</RunThunderPipePackAfterBuild>
<RunThunderPipePublishAfterBuild Condition="'$(RunThunderPipePublishAfterBuild)' != 'false' And '$(RunThunderPipePackAfterBuild)' == 'true' And '$(PublishTS)' == 'true'">true</RunThunderPipePublishAfterBuild>
</PropertyGroup>
</Project>
72 changes: 48 additions & 24 deletions src/ShipInventoryUpdated/ShipInventoryUpdated.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- BepInEx Properties -->
<PropertyGroup>
<AssemblyName>ShipInventoryUpdated</AssemblyName>
<Product>ShipInventoryUpdated</Product>
<Authors>LethalCompanyModding</Authors>
<Description>Adds an inventory to the ship, allowing it to store items and retrieve them.</Description>
<PackageProjectUrl>https://github.com/LethalCompanyModding/ShipInventoryCommunity</PackageProjectUrl>
</PropertyGroup>
<!-- BepInEx Properties -->
<PropertyGroup>
<AssemblyName>ShipInventoryUpdated</AssemblyName>
<Product>ShipInventoryUpdated</Product>
<Authors>LethalCompanyModding</Authors>
<Description>Adds an inventory to the ship, allowing it to store items and retrieve them.</Description>
<PackageProjectUrl>https://github.com/LethalCompanyModding/ShipInventoryCommunity</PackageProjectUrl>
</PropertyGroup>

<!-- Project Properties -->
<PropertyGroup>
Expand All @@ -16,17 +16,17 @@

<!-- Primary Package References -->
<ItemGroup>
<PackageReference Include="BepInEx.Analyzers" Version="1.*" PrivateAssets="all" />
<PackageReference Include="BepInEx.Core" Version="5.*" PrivateAssets="all" />
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.5.0-beta.2" PrivateAssets="all" />
<PackageReference Include="BepInEx.Analyzers" Version="1.*" PrivateAssets="all"/>
<PackageReference Include="BepInEx.Core" Version="5.*" PrivateAssets="all"/>
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.5.0-beta.2" PrivateAssets="all"/>
<PackageReference Include="Evaisa.NetcodePatcher.MSBuild" Version="4.5.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="LethalCompany.GameLibs.Steam" Version="*-*" PrivateAssets="all" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="UnityEngine.Modules" Version="2022.3.62" IncludeAssets="compile" PrivateAssets="all" />
<PackageReference Include="MinVer" Version="6.*" PrivateAssets="all" />
<PackageReference Include="LethalCompany.GameLibs.Steam" Version="*-*" PrivateAssets="all"/>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0"/>
<PackageReference Include="UnityEngine.Modules" Version="2022.3.62" IncludeAssets="compile" PrivateAssets="all"/>
<PackageReference Include="MinVer" Version="6.*" PrivateAssets="all"/>
</ItemGroup>

<!-- Dependencies -->
Expand All @@ -39,11 +39,35 @@
<PackageReference Include="AinaVT-LethalConfig" Version="1.4.6" PrivateAssets="all" />
</ItemGroup>

<Target Name="NetcodePatch" AfterTargets="PostBuildEvent">
<PropertyGroup>
<NetcodePatcherDepsListFile>$(IntermediateOutputPath)ncp-deps.list</NetcodePatcherDepsListFile>
</PropertyGroup>
<WriteLinesToFile File="$(NetcodePatcherDepsListFile)" Lines="@(ReferencePathWithRefAssemblies)" Overwrite="true"/>
<Exec Command="dotnet tool run netcode-patch -uv 2022.3.62 -nv 1.12.2 -tv 1.0.0 &quot;$(TargetPath)&quot; --dependency-file &quot;$(NetcodePatcherDepsListFile)&quot;" />
</Target>
<!-- Thunderstore Package metadata -->
<PropertyGroup>
<ThunderstoreTeam>$(Authors)</ThunderstoreTeam>
<ThunderstoreName>$(Product)</ThunderstoreName>
<ThunderstoreDescription>$(Description)</ThunderstoreDescription>
<ThunderstoreWebsite>$(PackageProjectUrl)</ThunderstoreWebsite>

<ThunderstoreCommunities>lethal-company</ThunderstoreCommunities>
<ThunderstoreCategories>mods;tweaks-and-quality-of-life;performance;furniture</ThunderstoreCategories>

<ThunderstoreToken>$(THUNDERSTORE_TOKEN)</ThunderstoreToken>
</PropertyGroup>

<ItemGroup>
<!-- Mod Files -->
<ThunderstoreFile Include="$(TargetPath)" Destination="plugins/"/>
<ThunderstoreFile Include="$(ProjectRoot)Resources/Bundles/si-bundle" Destination="plugins/"/>
<ThunderstoreFile Include="$(ProjectRoot)Resources/Localization/*.json" Destination="plugins/"/>

<!-- Package Files -->
<ThunderstorePackageFile Include="$(SolutionDir)README.md"/>
<ThunderstorePackageFile Include="$(SolutionDir)CHANGELOG.md"/>
<ThunderstorePackageFile Include="$(SolutionDir)icon.png"/>
<ThunderstorePackageFile Include="$(SolutionDir)LICENSE"/>

<!-- Thunderstore Dependencies -->
<ThunderstoreDependency Include="BepInEx-BepInExPack" Version="5.4.2100"/>
<ThunderstoreDependency Include="Evaisa-LethalLib" Version="1.1.1"/>
<ThunderstoreDependency Include="WhiteSpike-Interactive_Terminal_API" Version="1.3.0"/>
<ThunderstoreDependency Include="Sigurd-CSync" Version="5.0.1"/>
</ItemGroup>
</Project>
Loading