From 38156e97d22e339313436974d923ea83a15bc005 Mon Sep 17 00:00:00 2001 From: Jonas Hansen Date: Thu, 11 Jan 2024 19:08:08 +0100 Subject: [PATCH] Fix build --- .github/workflows/build.yaml | 30 ++++--------------- ...ttNet.sln => HomeAssistantDiscoveryNet.sln | 0 .../HomeAssistantDiscoveryNet.csproj | 10 ++++--- src/ToMqttNet/ToMqttNet.csproj | 2 ++ 4 files changed, 13 insertions(+), 29 deletions(-) rename ToMqttNet.sln => HomeAssistantDiscoveryNet.sln (100%) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 000c028..1b2277a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,7 +15,6 @@ env: DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true - PROJECT_NAME: ToMqttNet # GitHub Packages Feed settings GITHUB_FEED: https://nuget.pkg.github.com/JonasMH/ GITHUB_USER: JonasMH @@ -43,27 +42,7 @@ jobs: - name: Test run: dotnet test -c Release - name: Pack - run: dotnet pack -v normal -c Release --no-restore --include-symbols --include-source src/$PROJECT_NAME/$PROJECT_NAME.*proj - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: nupkg - path: ./src/${{ env.PROJECT_NAME }}/bin/Release/*.nupkg - prerelease: - needs: build - if: github.ref == 'refs/heads/develop' - runs-on: ubuntu-latest - steps: - - name: Download Artifact - uses: actions/download-artifact@v1 - with: - name: nupkg - - name: Push to GitHub Feed - run: | - for f in ./nupkg/*.nupkg - do - curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$f $GITHUB_FEED - done + run: dotnet pack -o artifacts/packs -v normal -c Release --no-restore HomeAssistantDiscoveryNet.sln deploy: needs: build if: github.event_name == 'release' @@ -83,12 +62,13 @@ jobs: echo Version: $VERSION VERSION="${VERSION//v}" echo Clean Version: $VERSION - dotnet pack -v normal -c Release --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg src/$PROJECT_NAME/$PROJECT_NAME.*proj + dotnet pack -o artifacts/packs -v normal -c Release --no-restore -p:PackageVersion=$VERSION HomeAssistantDiscoveryNet.sln - name: Push to GitHub Feed run: | - for f in ./nupkg/*.nupkg + for f in ./artifacts/packs/*.nupkg + do curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$f $GITHUB_FEED done - name: Push to NuGet Feed - run: dotnet nuget push ./nupkg/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key $NUGET_KEY + run: dotnet nuget push ./artifacts/packs/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key $NUGET_KEY diff --git a/ToMqttNet.sln b/HomeAssistantDiscoveryNet.sln similarity index 100% rename from ToMqttNet.sln rename to HomeAssistantDiscoveryNet.sln diff --git a/src/HomeAssistantDiscoveryNet/HomeAssistantDiscoveryNet.csproj b/src/HomeAssistantDiscoveryNet/HomeAssistantDiscoveryNet.csproj index 8a050e5..da4b8ba 100644 --- a/src/HomeAssistantDiscoveryNet/HomeAssistantDiscoveryNet.csproj +++ b/src/HomeAssistantDiscoveryNet/HomeAssistantDiscoveryNet.csproj @@ -1,8 +1,8 @@  - - net8.0 - enable + + net8.0 + enable enable true @@ -13,7 +13,9 @@ ASP.NET Hosted MQTT Connection and models to make it easier to work with Home Assistant MQTT Discovery https://github.com/JonasMH/HomeAssistantDiscoveryNet true - + snupkg + true + $(NoWarn);1591 diff --git a/src/ToMqttNet/ToMqttNet.csproj b/src/ToMqttNet/ToMqttNet.csproj index e8c1a63..5d74e83 100644 --- a/src/ToMqttNet/ToMqttNet.csproj +++ b/src/ToMqttNet/ToMqttNet.csproj @@ -6,6 +6,8 @@ enable enable true + snupkg + true true