Skip to content

Commit dd2f4fb

Browse files
committed
Added github action to create and publish nuget package
1 parent 5168ec5 commit dd2f4fb

File tree

3 files changed

+57
-5
lines changed

3 files changed

+57
-5
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and publish NuGet
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
publish:
11+
name: build, pack & publish
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Publish NuGet
16+
id: publishNuGet
17+
uses: brandedoutcast/[email protected]
18+
with:
19+
# Filepath of the project to be packaged, relative to root of repository
20+
PROJECT_FILE_PATH: src/SpatialFocus.EntityFrameworkCore.Extensions/SpatialFocus.EntityFrameworkCore.Extensions.csproj
21+
# NuGet package id, used for version detection & defaults to project name
22+
PACKAGE_NAME: SpatialFocus.EntityFrameworkCore.Extensions
23+
# API key to authenticate with NuGet server
24+
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
25+
# Flag to toggle pushing symbols along with nuget package to the server, disabled by default
26+
INCLUDE_SYMBOLS: true
27+
- name: Persist NuGet artifact
28+
uses: actions/upload-artifact@v1
29+
if: ${{steps.publishNuGet.outputs.PACKAGE_NAME != ''}}
30+
with:
31+
name: ${{steps.publishNuGet.outputs.PACKAGE_NAME}}
32+
path: ${{steps.publishNuGet.outputs.PACKAGE_PATH}}
33+
- name: Persist SNuGet artifact
34+
uses: actions/upload-artifact@v1
35+
if: ${{steps.publishNuGet.outputs.SYMBOLS_PACKAGE_NAME != ''}}
36+
with:
37+
name: ${{steps.publishNuGet.outputs.SYMBOLS_PACKAGE_NAME}}
38+
path: ${{steps.publishNuGet.outputs.SYMBOLS_PACKAGE_PATH}}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ publish/
136136
*.azurePubxml
137137

138138
# NuGet Packages Directory
139+
.nuget/
139140
packages/
140141
*.nuget.targets
141142
*.lock.json
Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<Version>2.1.0-beta1</Version>
4+
<TargetFramework>netstandard2.1</TargetFramework>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
8+
<Version>2.1.0-beta2</Version>
59
<PackageId>SpatialFocus.EntityFrameworkCore.Extensions</PackageId>
610
<Title>Spatial Focus EntityFrameworkCore Extensions</Title>
711
<Description>A set of useful extensions for EntityFrameworkCore (Enum Lookup Tables, Naming of tables / properties / keys, Pluralize).</Description>
812
<PackageTags>EntityFrameworkCore,EFCore,enum lookup,naming helpers</PackageTags>
913
<PackageProjectUrl>https://github.com/SpatialFocus/SpatialFocus.EntityFrameworkCore.Extensions</PackageProjectUrl>
10-
<PackageLicenseUrl>https://github.com/SpatialFocus/SpatialFocus.EntityFrameworkCore.Extensions/blob/master/LICENSE</PackageLicenseUrl>
14+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
15+
<PackageIcon>nuget-icon.png</PackageIcon>
1116
<PackageIconUrl>https://raw.githubusercontent.com/SpatialFocus/SpatialFocus.EntityFrameworkCore.Extensions/master/docs/nuget-icon.png</PackageIconUrl>
1217
<RepositoryType>git</RepositoryType>
1318
<RepositoryUrl>https://github.com/SpatialFocus/SpatialFocus.EntityFrameworkCore.Extensions.git</RepositoryUrl>
1419
<Authors>Dresel,pergerch</Authors>
1520
<Company>SpatialFocus</Company>
16-
<PackageOutputPath>..\..\.nuget\packages\SpatialFocus.EntityFrameworkCore.Extensions</PackageOutputPath>
21+
<PackageOutputPath>..\..\.nuget</PackageOutputPath>
1722
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
23+
24+
<IncludeSymbols>true</IncludeSymbols>
25+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
26+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
1827
</PropertyGroup>
1928

20-
<PropertyGroup>
21-
<TargetFramework>netstandard2.1</TargetFramework>
29+
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
30+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
2231
</PropertyGroup>
2332

2433
<ItemGroup>
@@ -27,4 +36,8 @@
2736
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.0" />
2837
</ItemGroup>
2938

39+
<ItemGroup>
40+
<None Include="..\..\docs\nuget-icon.png" Pack="true" PackagePath="\" />
41+
</ItemGroup>
42+
3043
</Project>

0 commit comments

Comments
 (0)