Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasMH committed Jan 11, 2024
1 parent 6a5f28c commit 38156e9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 29 deletions.
30 changes: 5 additions & 25 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand All @@ -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
File renamed without changes.
10 changes: 6 additions & 4 deletions src/HomeAssistantDiscoveryNet/HomeAssistantDiscoveryNet.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishAot>true</PublishAot>

Expand All @@ -13,7 +13,9 @@
<PackageDescription>ASP.NET Hosted MQTT Connection and models to make it easier to work with Home Assistant MQTT Discovery</PackageDescription>
<RepositoryUrl>https://github.com/JonasMH/HomeAssistantDiscoveryNet</RepositoryUrl>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSymbols>true</IncludeSymbols>

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

Expand Down
2 changes: 2 additions & 0 deletions src/ToMqttNet/ToMqttNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishAot>true</PublishAot>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSymbols>true</IncludeSymbols>

<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>

Expand Down

0 comments on commit 38156e9

Please sign in to comment.