Skip to content

Commit

Permalink
Merge pull request #12 from dotnet-campus/t/lindexi/FixBuild
Browse files Browse the repository at this point in the history
尝试修复推送包
  • Loading branch information
walterlv authored Nov 21, 2024
2 parents a2776ae + 47e9194 commit f91d6c2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: .NET Build

on: [push, pull_request]
on: push

jobs:

Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/nuget-tag-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install dotnet tool
run: dotnet tool install -g dotnetCampus.TagToVersion

- name: Set tag to version
run: dotnet TagToVersion -t ${{ github.ref }}

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand All @@ -22,12 +28,7 @@ jobs:
6.0.x
8.0.x
9.0.x
- name: Install dotnet tool
run: dotnet tool install -g dotnetCampus.TagToVersion
- name: Set tag to version
run: dotnet TagToVersion -t ${{ github.ref }}
- name: Build with dotnet
run: |
Expand Down
2 changes: 1 addition & 1 deletion src/dotnetCampus.AppHost/Patches/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# .NET Runtime 仓库补丁说明
# .NET Runtime 仓库补丁说明

## AppHost.exe 编译方法

Expand Down
10 changes: 9 additions & 1 deletion src/dotnetCampus.AppHost/Program.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
#if !NET8_0
#if !IS_EXE_TOOL
using System;

internal static class Program
{
private static void Main()
{
throw new NotSupportedException("不支持 .NET 8.0 以下的版本。通常是 NuGet 包制作错误,如看到此异常,请到 https://github.com/dotnet-campus/dotnetCampus.AppHost 提 Issues");
}
}
#else
using System;
using dotnetCampus.AppHosting.Tasks;
using dotnetCampus.Cli;
using dotnetCampus.MSBuildUtils;

try
{
Console.WriteLine(new MSBuildMessage($"开始执行 dotnet campus AppHost 替换工作。命令行参数:{Environment.CommandLine}").ToString(MessageLevel.Message));

var options = CommandLine.Parse(args)
.AddHandler<AppHostPatchingTask>(o => o.Run())
.Run();

Console.WriteLine(new MSBuildMessage("完成 dotnet campus AppHost 替换工作").ToString(MessageLevel.Message));
}
catch (MSBuildException ex)
{
Expand Down
8 changes: 5 additions & 3 deletions src/dotnetCampus.AppHost/dotnetCampus.AppHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net8.0;net6.0;netstandard2.0;net45</TargetFrameworks>
<ExeAsToolFramework>net8.0</ExeAsToolFramework>
<DefineConstants Condition="'$(TargetFramework)' == '$(ExeAsToolFramework)'">$(DefineConstants);IS_EXE_TOOL</DefineConstants>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RootNamespace>dotnetCampus.AppHosting</RootNamespace>
Expand Down Expand Up @@ -30,7 +32,7 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

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

<ItemGroup Condition="'$(TargetFramework)' != 'net8.0'">
<ItemGroup Condition="'$(TargetFramework)' != '$(ExeAsToolFramework)'">
<Compile Remove="**\*.cs" />
<Compile Include="Program.cs" />
</ItemGroup>
Expand All @@ -55,7 +57,7 @@
<None Include="Assets\build\Build.props" Pack="True" PackagePath="build\$(PackageId).props" />
<None Include="Assets\build\Build.targets" Pack="True" PackagePath="build\$(PackageId).targets" />
<None Include="Assets\template\**" Pack="True" PackagePath="template" />
<None Include="$(OutputPath)net6.0\**" Pack="True" PackagePath="tools" />
<None Include="$(OutputPath)$(ExeAsToolFramework)\**" Pack="True" PackagePath="tools" />
</ItemGroup>
</Target>

Expand Down

0 comments on commit f91d6c2

Please sign in to comment.