Skip to content

Commit

Permalink
Added github action to create and publish nuget package
Browse files Browse the repository at this point in the history
  • Loading branch information
pergerch committed Sep 16, 2020
1 parent 5168ec5 commit dd2f4fb
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 5 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and publish NuGet

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
publish:
name: build, pack & publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Publish NuGet
id: publishNuGet
uses: brandedoutcast/publish-nuget@v2.5.5
with:
# Filepath of the project to be packaged, relative to root of repository
PROJECT_FILE_PATH: src/SpatialFocus.EntityFrameworkCore.Extensions/SpatialFocus.EntityFrameworkCore.Extensions.csproj
# NuGet package id, used for version detection & defaults to project name
PACKAGE_NAME: SpatialFocus.EntityFrameworkCore.Extensions
# API key to authenticate with NuGet server
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
# Flag to toggle pushing symbols along with nuget package to the server, disabled by default
INCLUDE_SYMBOLS: true
- name: Persist NuGet artifact
uses: actions/upload-artifact@v1
if: ${{steps.publishNuGet.outputs.PACKAGE_NAME != ''}}
with:
name: ${{steps.publishNuGet.outputs.PACKAGE_NAME}}
path: ${{steps.publishNuGet.outputs.PACKAGE_PATH}}
- name: Persist SNuGet artifact
uses: actions/upload-artifact@v1
if: ${{steps.publishNuGet.outputs.SYMBOLS_PACKAGE_NAME != ''}}
with:
name: ${{steps.publishNuGet.outputs.SYMBOLS_PACKAGE_NAME}}
path: ${{steps.publishNuGet.outputs.SYMBOLS_PACKAGE_PATH}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ publish/
*.azurePubxml

# NuGet Packages Directory
.nuget/
packages/
*.nuget.targets
*.lock.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>2.1.0-beta1</Version>
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<Version>2.1.0-beta2</Version>
<PackageId>SpatialFocus.EntityFrameworkCore.Extensions</PackageId>
<Title>Spatial Focus EntityFrameworkCore Extensions</Title>
<Description>A set of useful extensions for EntityFrameworkCore (Enum Lookup Tables, Naming of tables / properties / keys, Pluralize).</Description>
<PackageTags>EntityFrameworkCore,EFCore,enum lookup,naming helpers</PackageTags>
<PackageProjectUrl>https://github.com/SpatialFocus/SpatialFocus.EntityFrameworkCore.Extensions</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/SpatialFocus/SpatialFocus.EntityFrameworkCore.Extensions/blob/master/LICENSE</PackageLicenseUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>nuget-icon.png</PackageIcon>
<PackageIconUrl>https://raw.githubusercontent.com/SpatialFocus/SpatialFocus.EntityFrameworkCore.Extensions/master/docs/nuget-icon.png</PackageIconUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/SpatialFocus/SpatialFocus.EntityFrameworkCore.Extensions.git</RepositoryUrl>
<Authors>Dresel,pergerch</Authors>
<Company>SpatialFocus</Company>
<PackageOutputPath>..\..\.nuget\packages\SpatialFocus.EntityFrameworkCore.Extensions</PackageOutputPath>
<PackageOutputPath>..\..\.nuget</PackageOutputPath>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>

<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup>
Expand All @@ -27,4 +36,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.0" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\docs\nuget-icon.png" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>

0 comments on commit dd2f4fb

Please sign in to comment.