Skip to content

Commit

Permalink
Adding initial nuget publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jakenuts committed Dec 13, 2023
1 parent e8db610 commit 725106c
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ jobs:
- name: Test
run: dotnet test ${{ env.SOLUTION }} --no-build --verbosity normal --configuration ${{ env.CONFIG }}
- name: Package
run: dotnet pack ${{ env.PROJECT }} -c ${{ env.CONFIG }} --output ./publish
run: dotnet pack ${{ env.PROJECT }} --no-build -c ${{ env.CONFIG }} --output ./publish
- name: Publish
run: dotnet nuget push ./publish/*.nupkg --api-key ${{secrets.GITHUB_TOKEN}} --source "github"


6 changes: 6 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
38 changes: 38 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<Project>
<PropertyGroup Label="Settings">
<Deterministic>true</Deterministic>
<LangVersion>10</LangVersion>
<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>
<MinVerSkip Condition="'$(Configuration)' == 'Debug'">true</MinVerSkip>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Label="Deterministic Build" Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup Label="Package Information">
<Description>A library assists with hosting Spectre.Console.Cli in a HostApplicationBuilder based app.</Description>
<Copyright></Copyright>
<Authors></Authors>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/jakenuts/Spectre.Console.Extensions.Hosting</RepositoryUrl>
<!-- <PackageIcon>small-logo.png</PackageIcon> -->
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<PackageProjectUrl>https://github.com/jakenuts/Spectre.Console.Extensions.Hosting</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReleaseNotes>https://github.com/jakenuts/Spectre.Console.Extensions.Hosting/releases</PackageReleaseNotes>
</PropertyGroup>

<PropertyGroup Label="Source Link">
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<ItemGroup Label="Package References">
<PackageReference Include="MinVer" PrivateAssets="All" Version="4.2.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" Version="*" />
</ItemGroup>
</Project>
8 changes: 8 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<Target Name="Versioning" BeforeTargets="MinVer">
<PropertyGroup Label="Build">
<MinVerDefaultPreReleasePhase>preview</MinVerDefaultPreReleasePhase>
<MinVerVerbosity>normal</MinVerVerbosity>
</PropertyGroup>
</Target>
</Project>
3 changes: 3 additions & 0 deletions src/Spectre.Console.Extensions.Hosting.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8905AA16-D82A-4103-8534-147EDD27B7FA}"
ProjectSection(SolutionItems) = preProject
..\.gitignore = ..\.gitignore
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
..\.github\workflows\dotnet.yml = ..\.github\workflows\dotnet.yml
..\LICENSE = ..\LICENSE
..\NuGet.Config = ..\NuGet.Config
..\README.md = ..\README.md
EndProjectSection
EndProject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0;</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>true</IsPackable>
<PackageId>Spectre.Console.Extensions.Hosting</PackageId>
<Version>1.0.0</Version>
</PropertyGroup>


Expand Down
7 changes: 7 additions & 0 deletions src/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "http://json.schemastore.org/global",
"sdk": {
"version": "8.0.100",
"rollForward": "latestFeature"
}
}

0 comments on commit 725106c

Please sign in to comment.