improve: better version control

This commit is contained in:
h z
2025-02-18 21:22:47 +00:00
parent 3a08d8ae16
commit cadb3e02ac
2 changed files with 22 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="VersionInfo.props" Condition="Exists('VersionInfo.props')" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>true</IsPackable>
@@ -8,7 +8,7 @@
<RootNamespace>Polonium.Tasks</RootNamespace>
<AssemblyName>Polonium.Tasks</AssemblyName>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.1.1-x</Version>
<Version>$(PoloniumTasksVersion)</Version>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<GenerateDependencyFile>true</GenerateDependencyFile>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
@@ -18,21 +18,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference
Include="Microsoft.Build"
Version="17.12.6"
PrivateAssets="all"
/>
<PackageReference
Include="Microsoft.Build.Tasks.Core"
Version="17.12.6"
PrivateAssets="all"
/>
<PackageReference
Include="Microsoft.CodeAnalysis"
Version="4.12.0"
PrivateAssets="all"
/>
<PackageReference Include="Microsoft.Build" Version="17.12.6" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="17.12.6" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.12.0" PrivateAssets="all" />
<EmbeddedResource Update="Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -44,11 +32,8 @@
</Compile>
<AdditionalFiles Remove="AnalyzerReleases.Shipped.md" />
<AdditionalFiles Remove="AnalyzerReleases.Unshipped.md" />
<None
Include="Package/build/**/*"
Pack="true"
PackagePath="build"
/>
<None Include="Package/build/**/*" Pack="true" PackagePath="build" />
<None Include="VersionInfo.props" Condition="Exists('VersionInfo.props')" Pack="true" PackagePath="build" />
</ItemGroup>
<Target Name="CopyProjectReferencesToPackage" DependsOnTargets="ResolveReferences">
<ItemGroup>
@@ -64,10 +49,10 @@
Condition="'$(GenerateDependencyFile)' == 'true'"
>
<ItemGroup>
<BuiltProjectOutputGroupOutput
Include="$(ProjectDepsFilePath)"
TargetPath="$(ProjectDepsFileName)"
FinalOutputPath="$(ProjectDepsFilePath)"
<BuiltProjectOutputGroupOutput
Include="$(ProjectDepsFilePath)"
TargetPath="$(ProjectDepsFileName)"
FinalOutputPath="$(ProjectDepsFilePath)"
/>
</ItemGroup>
</Target>

12
publish Normal file → Executable file
View File

@@ -1,2 +1,12 @@
#!/bin/bash
dotnet nuget push "$(ls -t ./bin/Debug/Polonium.Tasks.*.nupkg | head -n 1)" --source hangman-lab
SCRIPT_DIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")")/
LATEST_PACKAGE=$(ls -t "${SCRIPT_DIR}"bin/Debug/Polonium.Tasks.*.nupkg 2>/dev/null | head -n 1)
if [[ -z "$LATEST_PACKAGE" ]]; then
echo "❌ Error: No .nupkg file found in ${SCRIPT_DIR}/bin/Debug/"
exit 1
fi
echo "🚀 Pushing NuGet package: $LATEST_PACKAGE"
dotnet nuget push "$LATEST_PACKAGE" --source hangman-lab