diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b3b236f..0c2d281 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e830f45..e62caf0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 diff --git a/Directory.Build.props b/Directory.Build.props index e410279..abcbf60 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,10 +1,5 @@ - - git - __PROJECT_URL__ - - false true diff --git a/Directory.Build.targets b/Directory.Build.targets index 6a41ce5..c30f596 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,4 +1,5 @@ + + + + + $(IntermediateOutputPath)ncp-deps.list + + + + + + + + $(MinVerMajor).$(MinVerMinor).$(MinVerPatch) + + + + + true + true + \ No newline at end of file diff --git a/src/ShipInventoryUpdated/ShipInventoryUpdated.csproj b/src/ShipInventoryUpdated/ShipInventoryUpdated.csproj index f1fa02f..895a1d5 100644 --- a/src/ShipInventoryUpdated/ShipInventoryUpdated.csproj +++ b/src/ShipInventoryUpdated/ShipInventoryUpdated.csproj @@ -1,12 +1,12 @@ - - - ShipInventoryUpdated - ShipInventoryUpdated - LethalCompanyModding - Adds an inventory to the ship, allowing it to store items and retrieve them. - https://github.com/LethalCompanyModding/ShipInventoryCommunity - + + + ShipInventoryUpdated + ShipInventoryUpdated + LethalCompanyModding + Adds an inventory to the ship, allowing it to store items and retrieve them. + https://github.com/LethalCompanyModding/ShipInventoryCommunity + @@ -16,17 +16,17 @@ - - - + + + - runtime; build; native; contentfiles; analyzers; buildtransitive - all + runtime; build; native; contentfiles; analyzers; buildtransitive + all - - - - + + + + @@ -39,11 +39,35 @@ - - - $(IntermediateOutputPath)ncp-deps.list - - - - + + + $(Authors) + $(Product) + $(Description) + $(PackageProjectUrl) + + lethal-company + mods;tweaks-and-quality-of-life;performance;furniture + + $(THUNDERSTORE_TOKEN) + + + + + + + + + + + + + + + + + + + + \ No newline at end of file