添加项目文件。

This commit is contained in:
lindexi
2021-08-22 19:54:30 +08:00
parent 4bbd365839
commit 1ee2f98afb
10 changed files with 199 additions and 0 deletions

17
.github/workflows/dotnet-build.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: .NET Build
on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Build with dotnet
run: dotnet build --configuration Release
- name: Test
run: dotnet test --configuration Release

View File

@@ -0,0 +1,40 @@
# 去掉注释可以合并 master 分支自动打包
# 为什么不期望推送 master 自动打包?原因是打出来的 CBB 没有 Tag 不利于回滚找到代码
# name: publish nuget
# on:
# push:
# branches:
# - master
# jobs:
# build:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v1
# - name: Setup .NET Core
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: 3.1.300
# - name: Build with dotnet
# run: |
# dotnet build --configuration Release
# dotnet pack --configuration Release --no-build
# - name: Install Nuget
# uses: nuget/setup-nuget@v1
# with:
# nuget-version: '5.x'
# - name: Add private GitHub registry to NuGet
# run: |
# nuget sources add -name github -Source https://nuget.pkg.github.com/dotnet-campus/index.json -Username dotnet-campus -Password ${{ secrets.GITHUB_TOKEN }}
# - name: Push generated package to GitHub registry
# run: |
# nuget push .\bin\Release\*.nupkg -Source github -SkipDuplicate
# nuget push .\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }}

39
.github/workflows/nuget-tag-publish.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: publish nuget
on:
push:
tags:
- '*'
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- 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: |
dotnet build --configuration Release
dotnet pack --configuration Release --no-build
- name: Install Nuget
uses: nuget/setup-nuget@v1
with:
nuget-version: '5.x'
- name: Add private GitHub registry to NuGet
run: |
nuget sources add -name github -Source https://nuget.pkg.github.com/dotnet-campus/index.json -Username dotnet-campus -Password ${{ secrets.GITHUB_TOKEN }}
- name: Push generated package to GitHub registry
run: |
nuget push .\bin\Release\*.nupkg -Source github -SkipDuplicate
nuget push .\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }}

1
CHANGELOG.md Normal file
View File

@@ -0,0 +1 @@
# dotnetCampus.ApplicationStartupManager

17
Directory.Build.props Normal file
View File

@@ -0,0 +1,17 @@
<Project>
<Import Project="build\Version.props" />
<PropertyGroup>
<LangVersion>latest</LangVersion>
<PackageOutputPath>$(MSBuildThisFileDirectory)bin\$(Configuration)</PackageOutputPath>
<Company>dotnet campus.NET 职业技术学院)</Company>
<!-- 替换下面信息 -->
<Authors>dotnet-campus</Authors>
<RepositoryUrl>https://github.com/dotnet-campus/dotnetCampus.ApplicationStartupManager</RepositoryUrl>
<PackageProjectUrl>https://github.com/dotnet-campus/dotnetCampus.ApplicationStartupManager</PackageProjectUrl>
<Description>TODO: 请在此处添加包描述信息。</Description>
<RepositoryType>git</RepositoryType>
<Copyright>Copyright © 2021 dotnet campus, All Rights Reserved.</Copyright>
</PropertyGroup>
</Project>

5
README.md Normal file
View File

@@ -0,0 +1,5 @@
# dotnetCampus.ApplicationStartupManager
| Build | NuGet |
|--|--|
|![](https://github.com/dotnet-campus/dotnetCampus.ApplicationStartupManager/workflows/.NET%20Build/badge.svg)|[![](https://img.shields.io/nuget/v/dotnetCampus.ApplicationStartupManager.svg)](https://www.nuget.org/packages/dotnetCampus.ApplicationStartupManager)|

5
build/Version.props Normal file
View File

@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<Version>1.0.0</Version>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,30 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31605.320
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5D196596-756D-45C2-8A05-C8E4AB8A36E6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetCampus.ApplicationStartupManager", "src\dotnetCampus.ApplicationStartupManager\dotnetCampus.ApplicationStartupManager.csproj", "{F7ED61F4-920C-49EB-8DC1-74B2BE6AF272}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F7ED61F4-920C-49EB-8DC1-74B2BE6AF272}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F7ED61F4-920C-49EB-8DC1-74B2BE6AF272}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7ED61F4-920C-49EB-8DC1-74B2BE6AF272}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7ED61F4-920C-49EB-8DC1-74B2BE6AF272}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F7ED61F4-920C-49EB-8DC1-74B2BE6AF272} = {5D196596-756D-45C2-8A05-C8E4AB8A36E6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8AAD3A7E-EBB6-4125-9048-4CDE053D079B}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,9 @@
using System;
namespace dotnetCampus.ApplicationStartupManager
{
class Class1
{
}
}

View File

@@ -0,0 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netstandard2.0;net45</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<!-- 在 GitHub 的 Action 构建会添加 GITHUB_ACTIONS 变量 -->
<!-- 下面进行自动构建,自动添加源代码链接等 -->
<!-- 详细请看 https://github.com/dotnet/sourcelink -->
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- 只有在 GitHub 的 Action 构建才能使用源代码链接 -->
<!-- 源代码链接需要使用 commit 号,而在 GitHub 的 Action 构建的 commit 才是对的 -->
<!-- 本地构建,也许没有记得 commit 就构建,此时的 nuget 包的源代码是不对的,上传上去会让调试诡异 -->
<!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- 本地等不需要创建符号文件 -->
<!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<ItemGroup>
<!-- 链接源代码到 GitHub 仓库,方便调试 -->
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>
</Project>