diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 9dfa82c..96bd981 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -8,13 +8,6 @@ "netcode-patch" ], "rollForward": false - }, - "tcli": { - "version": "0.2.4", - "commands": [ - "tcli" - ], - "rollForward": false } } } \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c845d9b..2b34221 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,30 +1,78 @@ -name: Publish Mod To TS +name: 'Publish Package' on: - push: - tags: "*" + push: + tags: + - '*' jobs: - publish: - runs-on: ubuntu-latest - steps: - # Use checkout to publish the files in your repo - - name: Checkout - uses: actions/checkout@v4 + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v5 + with: + dotnet-version: | + 8.x + 9.x - - name: Setup Dotnet - uses: actions/setup-dotnet@v5 - with: - dotnet-version: "9.x" - - - name: Restore and Build - run: | - dotnet restore - dotnet tool restore - - - name: Publish to TS - env: - TCLI_AUTH_TOKEN: ${{ secrets.TCLI_AUTH_TOKEN }} - PACKAGE_VERSION: ${{ github.ref_name }} - run: | - dotnet publish -c Release + - 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 + 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 diff --git a/.gitignore b/.gitignore index ba5a0ae..4ce0b2f 100644 --- a/.gitignore +++ b/.gitignore @@ -221,5 +221,3 @@ node_modules/ *.sln.iml # End of https://www.toptal.com/developers/gitignore/api/csharp -artifacts/*/dist/**/* -artifacts/**/*.zip diff --git a/artifacts/tspublish/thunderstore.toml b/artifacts/tspublish/thunderstore.toml deleted file mode 100644 index d505e16..0000000 --- a/artifacts/tspublish/thunderstore.toml +++ /dev/null @@ -1,48 +0,0 @@ -#Don't change this -[config] - schemaVersion="0.0.1" - -[package] - #Edit this in the CSPROJ instead, the workflow will automate copying - #it here for you - description="Adds an inventory to the ship, allowing it to store items and retrieve them." - - #Change this to true if your mod has any NSFW content. Please follow the rules - #on image and text content on your listing or your package may be removed - containsNsfwContent=false - - #This is the link that shows up in the top right of the package page - #while it can be anything, I suggest keeping it as your github - websiteUrl="https://github.com/LethalCompanyModding/ShipInventoryCommunity" - - #This is where you put in dependencies in the format - #DependencyNamespace-ModName = "version.number.here" - [package.dependencies] - BepInEx-BepInExPack ="5.4.2100" - Evaisa-LethalLib ="1.1.1" - WhiteSpike-Interactive_Terminal_API="1.3.0" - -#These settings will import the repo's README.md file and the icon in the -#same folder as this TOML file as your icon. Please replace the icon with -#something prettier! You do not need to modify these settings! -[build] - icon ="./icon.png" - outdir="./build" - readme="./../../README.md" - - [[build.copy]] - source="./dist" - target="./" - -#Don't change this -[general] - repository="https://thunderstore.io" - -#Don't change this -[publish] - communities=["lethal-company"] - repository ="https://thunderstore.io" - - #There is a list of tags in the tutorial - [publish.categories] - lethal-company=["mods", "tweaks-and-quality-of-life", "performance", "furniture"] diff --git a/artifacts/tspublish/icon.png b/icon.png similarity index 100% rename from artifacts/tspublish/icon.png rename to icon.png diff --git a/src/ShipInventoryUpdated/Properties/PublishProfiles/Thunderstore.pubxml b/src/ShipInventoryUpdated/Properties/PublishProfiles/Thunderstore.pubxml deleted file mode 100644 index 8a07530..0000000 --- a/src/ShipInventoryUpdated/Properties/PublishProfiles/Thunderstore.pubxml +++ /dev/null @@ -1,77 +0,0 @@ - - - - True - False - True - False - True - True - bin\**;obj\** - Release - Any CPU - False - FileSystem - $(SolutionDir)\artifacts\tspublish\dist\plugins - $(TargetFramework) - FileSystem - True - True - True - False - FileSystem - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ShipInventoryUpdated/ShipInventoryUpdated.csproj b/src/ShipInventoryUpdated/ShipInventoryUpdated.csproj index 698c7f1..c1923bc 100644 --- a/src/ShipInventoryUpdated/ShipInventoryUpdated.csproj +++ b/src/ShipInventoryUpdated/ShipInventoryUpdated.csproj @@ -5,6 +5,7 @@ ShipInventoryUpdated LethalCompanyModding Adds an inventory to the ship, allowing it to store items and retrieve them. + https://github.com/LethalCompanyModding/ShipInventoryCommunity