Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit f91d6c2

Browse files
authored
Merge pull request #12 from dotnet-campus/t/lindexi/FixBuild
尝试修复推送包
2 parents a2776ae + 47e9194 commit f91d6c2

File tree

5 files changed

+22
-11
lines changed

5 files changed

+22
-11
lines changed

.github/workflows/dotnet-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: .NET Build
22

3-
on: [push, pull_request]
3+
on: push
44

55
jobs:
66

.github/workflows/nuget-tag-publish.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515

16+
- name: Install dotnet tool
17+
run: dotnet tool install -g dotnetCampus.TagToVersion
18+
19+
- name: Set tag to version
20+
run: dotnet TagToVersion -t ${{ github.ref }}
21+
1622
- name: Setup .NET
1723
uses: actions/setup-dotnet@v4
1824
with:
@@ -22,12 +28,7 @@ jobs:
2228
6.0.x
2329
8.0.x
2430
9.0.x
25-
26-
- name: Install dotnet tool
27-
run: dotnet tool install -g dotnetCampus.TagToVersion
2831
29-
- name: Set tag to version
30-
run: dotnet TagToVersion -t ${{ github.ref }}
3132
3233
- name: Build with dotnet
3334
run: |

src/dotnetCampus.AppHost/Patches/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# .NET Runtime 仓库补丁说明
1+
# .NET Runtime 仓库补丁说明
22

33
## AppHost.exe 编译方法
44

src/dotnetCampus.AppHost/Program.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
1-
#if !NET8_0
1+
#if !IS_EXE_TOOL
2+
using System;
3+
24
internal static class Program
35
{
46
private static void Main()
57
{
8+
throw new NotSupportedException("不支持 .NET 8.0 以下的版本。通常是 NuGet 包制作错误,如看到此异常,请到 https://github.com/dotnet-campus/dotnetCampus.AppHost 提 Issues");
69
}
710
}
811
#else
12+
using System;
913
using dotnetCampus.AppHosting.Tasks;
1014
using dotnetCampus.Cli;
1115
using dotnetCampus.MSBuildUtils;
1216

1317
try
1418
{
19+
Console.WriteLine(new MSBuildMessage($"开始执行 dotnet campus AppHost 替换工作。命令行参数:{Environment.CommandLine}").ToString(MessageLevel.Message));
20+
1521
var options = CommandLine.Parse(args)
1622
.AddHandler<AppHostPatchingTask>(o => o.Run())
1723
.Run();
24+
25+
Console.WriteLine(new MSBuildMessage("完成 dotnet campus AppHost 替换工作").ToString(MessageLevel.Message));
1826
}
1927
catch (MSBuildException ex)
2028
{

src/dotnetCampus.AppHost/dotnetCampus.AppHost.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
55
<TargetFrameworks>net8.0;net6.0;netstandard2.0;net45</TargetFrameworks>
6+
<ExeAsToolFramework>net8.0</ExeAsToolFramework>
7+
<DefineConstants Condition="'$(TargetFramework)' == '$(ExeAsToolFramework)'">$(DefineConstants);IS_EXE_TOOL</DefineConstants>
68
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
79
<GenerateDocumentationFile>true</GenerateDocumentationFile>
810
<RootNamespace>dotnetCampus.AppHosting</RootNamespace>
@@ -30,7 +32,7 @@
3032
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
3133
</PropertyGroup>
3234

33-
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
35+
<ItemGroup Condition="'$(TargetFramework)' == '$(ExeAsToolFramework)'">
3436
<PackageReference Include="dotnetCampus.CommandLine.Source" Version="3.3.0" PrivateAssets="All" />
3537
<PackageReference Include="dotnetCampus.Configurations.Source" Version="1.6.8" PrivateAssets="All" />
3638
<PackageReference Include="dotnetCampus.MSBuildUtils.Source" Version="1.1.0" PrivateAssets="All" />
@@ -40,7 +42,7 @@
4042
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
4143
</ItemGroup>
4244

43-
<ItemGroup Condition="'$(TargetFramework)' != 'net8.0'">
45+
<ItemGroup Condition="'$(TargetFramework)' != '$(ExeAsToolFramework)'">
4446
<Compile Remove="**\*.cs" />
4547
<Compile Include="Program.cs" />
4648
</ItemGroup>
@@ -55,7 +57,7 @@
5557
<None Include="Assets\build\Build.props" Pack="True" PackagePath="build\$(PackageId).props" />
5658
<None Include="Assets\build\Build.targets" Pack="True" PackagePath="build\$(PackageId).targets" />
5759
<None Include="Assets\template\**" Pack="True" PackagePath="template" />
58-
<None Include="$(OutputPath)net6.0\**" Pack="True" PackagePath="tools" />
60+
<None Include="$(OutputPath)$(ExeAsToolFramework)\**" Pack="True" PackagePath="tools" />
5961
</ItemGroup>
6062
</Target>
6163

0 commit comments

Comments
 (0)