Skip to content

Commit be57da4

Browse files
committed
自动打包
1 parent 822132f commit be57da4

5 files changed

Lines changed: 72 additions & 18 deletions

File tree

.github/workflows/PublishNuget.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: publish nuget
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
11+
runs-on: windows-latest
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
16+
- name: Setup .NET Core
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: 3.1.102
20+
- name: Build with dotnet
21+
run: |
22+
dotnet build --configuration Release
23+
- name: Install Nuget
24+
run: |
25+
$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
26+
$targetNugetExe = "nuget.exe"
27+
Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe
28+
- name: Add private GitHub registry to NuGet
29+
run: |
30+
.\nuget sources add -name github -Source https://nuget.pkg.github.com/ORGANIZATION_NAME/index.json -Username ORGANIZATION_NAME -Password ${{ secrets.GITHUB_TOKEN }}
31+
- name: Push generated package to GitHub registry
32+
run: |
33+
.\nuget push .\bin\release\*.nupkg -Source github -SkipDuplicate
34+
.\nuget push .\bin\release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} -NoSymbols

.github/workflows/dotnetcore.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: .NET Core
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: windows-latest
9+
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Build with dotnet
13+
run: dotnet build --configuration Release

Code/UsingMSBuildCopyOutputFileToFastDebug/UsingMSBuildCopyOutputFileToFastDebug.csproj

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,8 @@
33
<PropertyGroup>
44
<OutputType>Library</OutputType>
55
<TargetFrameworks>net48;netcoreapp2.2</TargetFrameworks>
6-
<Authors>dotnet-campus</Authors>
7-
<Product>dotnet-campus</Product>
8-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
9-
<PackageProjectUrl>https://github.com/dotnet-campus/UsingMSBuildCopyOutputFileToFastDebug</PackageProjectUrl>
10-
<RepositoryUrl>https://github.com/dotnet-campus/UsingMSBuildCopyOutputFileToFastDebug</RepositoryUrl>
11-
<Description>
12-
Using MSBuild Copy Output File To Fast Debug
13-
通过复制输出文件让 VisualStudio 外部启动快速调试底层库
14-
</Description>
15-
<Copyright>Copyright (c) 2019-2020 dotnet-campus</Copyright>
16-
<PackageTags>msbuild debug</PackageTags>
17-
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
18-
<BuildOutputTargetFolder>tools</BuildOutputTargetFolder>
19-
<NoPackageAnalysis>true</NoPackageAnalysis>
206
<ApplicationIcon />
217
<StartupObject />
22-
<Version>1.3.37</Version>
238
<PackageId>dotnetCampus.UsingMSBuildCopyOutputFileToFastDebug</PackageId>
249
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2510
</PropertyGroup>
@@ -31,14 +16,11 @@
3116
<ItemGroup>
3217
<PackageReference Include="Microsoft.Build.Framework" Version="16.0.461" />
3318
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.0.461" />
34-
<!--<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />-->
3519
<PackageReference Update="@(PackageReference)" PrivateAssets="All" />
3620
</ItemGroup>
3721

3822
<Target Name="UsingMSBuildCopyOutputFileToFastDebugPackage" BeforeTargets="_GetPackageFiles">
3923
<ItemGroup>
40-
<!--<None Include="$(OutputPath)\net48\Newtonsoft.Json.dll" Pack="True" PackagePath="\tools\net48\Newtonsoft.Json.dll" />
41-
<None Include="$(USERPROFILE)\.nuget\packages\Newtonsoft.Json\12.0.2\lib\netstandard2.0\Newtonsoft.Json.dll" Pack="True" PackagePath="\tools\netcoreapp2.2\Newtonsoft.Json.dll" />-->
4224
<None Include="build\dotnetCampus.UsingMSBuildCopyOutputFileToFastDebug.targets" Pack="True" PackagePath="\build\$(PackageId).targets" />
4325
<None Include="buildMultiTargeting\dotnetCampus.UsingMSBuildCopyOutputFileToFastDebug.targets" Pack="True" PackagePath="\buildMultiTargeting" />
4426
</ItemGroup>

Directory.Build.props

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project>
2+
<Import Project="build\Version.props" />
3+
<PropertyGroup>
4+
<PackageOutputPath>$(MSBuildThisFileDirectory)bin\$(Configuration)</PackageOutputPath>
5+
<Authors>dotnet-campus</Authors>
6+
<Product>dotnet-campus</Product>
7+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
8+
<PackageProjectUrl>https://github.com/dotnet-campus/UsingMSBuildCopyOutputFileToFastDebug</PackageProjectUrl>
9+
<RepositoryUrl>https://github.com/dotnet-campus/UsingMSBuildCopyOutputFileToFastDebug</RepositoryUrl>
10+
<Description>
11+
Using MSBuild Copy Output File To Fast Debug
12+
通过复制输出文件让 VisualStudio 外部启动快速调试底层库
13+
</Description>
14+
<Copyright>Copyright (c) 2019-2020 dotnet-campus</Copyright>
15+
<PackageTags>msbuild debug</PackageTags>
16+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
17+
<BuildOutputTargetFolder>tools</BuildOutputTargetFolder>
18+
<NoPackageAnalysis>true</NoPackageAnalysis>
19+
</PropertyGroup>
20+
</Project>

build/Version.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project>
2+
<PropertyGroup>
3+
<Version>1.3.61</Version>
4+
</PropertyGroup>
5+
</Project>

0 commit comments

Comments
 (0)