Skip to content

Commit 4307163

Browse files
authored
Merge pull request #12 from AinoraZ/AZ/feat/release-ci
Added Github Action for Package Release
2 parents 3f1ae4f + bfeb032 commit 4307163

File tree

4 files changed

+73
-11
lines changed

4 files changed

+73
-11
lines changed

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
on:
2+
release:
3+
types: [published]
4+
5+
env:
6+
NUGET_FEED: https://api.nuget.org/v3/index.json
7+
# Only tests subset of versioning for this repository: major.minor.patch and major.minor.patch-prerelease.prenum
8+
RELEASE_REGEX: ^([0-9]+)\.([0-9]+)\.([0-9]+)(-([a-z]+)\.([0-9]+))?$
9+
10+
jobs:
11+
build:
12+
runs-on: ${{ matrix.os }}
13+
timeout-minutes: 15
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest]
17+
dotnet-version: ["6.0.x"]
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 0
23+
- name: Setup dotnet ${{ matrix.dotnet-version }}
24+
uses: actions/setup-dotnet@v1
25+
with:
26+
dotnet-version: ${{ matrix.dotnet-version }}
27+
- name: Set VERSION variable from tag
28+
id: tag_version
29+
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
30+
- name: Check version validity
31+
run: |
32+
if [[ "${VERSION}" =~ ${RELEASE_REGEX} ]]; then
33+
echo "Release version: ${VERSION}"
34+
exit 0
35+
else
36+
echo "Invalid version: ${VERSION}"
37+
exit 1
38+
fi
39+
env:
40+
VERSION: ${{ steps.tag_version.outputs.VERSION }}
41+
- name: Build Release
42+
run: dotnet build --configuration Release /p:Version="${VERSION}"
43+
env:
44+
VERSION: ${{ steps.tag_version.outputs.VERSION }}
45+
- name: Test Release
46+
run: dotnet test --configuration Release --no-build
47+
- name: Pack
48+
run: dotnet pack --configuration Release /p:Version="${VERSION}" --include-symbols --no-build --output packed/
49+
env:
50+
VERSION: ${{ steps.tag_version.outputs.VERSION }}
51+
- name: Push
52+
run: dotnet nuget push packed/*.nupkg --source ${NUGET_FEED} --api-key ${NUGET_KEY} --skip-duplicate
53+
env:
54+
NUGET_KEY: ${{ secrets.NUGET_KEY }}
55+

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"Buildable",
55
"Diagnoser",
66
"Includable",
7+
"prenum", // prerelease number
78
"Xunit"
89
]
910
}

README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# EFCore.IncludeBuilder
22

3-
Extension library for Entity Framework Core that tries to improve upon the ```Include(...).ThenInclude(...)``` syntax to better support the following scenarios:
3+
Extension library for Entity Framework Core that tries to improve upon the ```Include(...).ThenInclude(...)``` syntax in order to better support the following scenarios:
44

55
- Loading multiple entities on the same level (siblings).
66
- Writing extension methods to include a whole set of entities at once.
@@ -9,7 +9,7 @@ Extension library for Entity Framework Core that tries to improve upon the ```In
99

1010
EFCore.IncludeBuilder allows you to load sibling entities without going up the whole include structure.
1111

12-
UseIncludeBuilder() syntax:
12+
```UseIncludeBuilder()``` syntax:
1313

1414
```csharp
1515
dbContext.Users
@@ -26,7 +26,7 @@ dbContext.Users
2626
.Build()
2727
```
2828

29-
Include(...).ThenInclude(...) syntax:
29+
```Include(...).ThenInclude(...)``` syntax:
3030

3131
```csharp
3232
dbContext.Users
@@ -86,7 +86,7 @@ dbContext.Users
8686

8787
## How It Works
8888

89-
EFCore.IncludeBuilder converts the includes You give it back to ```Include(...).ThenInclude(...)``` calls, so it *should* support all the same providers and functionality as the original.
89+
EFCore.IncludeBuilder converts the includes you give it back to ```Include(...).ThenInclude(...)``` calls, so it *should* support all the same providers and functionality as the original.
9090

9191
## Performance
9292

@@ -104,10 +104,3 @@ For larger queries that duplicate the same filters, it can even be the faster op
104104
| UseIncludeBuilder | 164.3 μs | 0.39 μs | 0.36 μs | 1.08 | 1.7090 | 0.4883 | 35 KB |
105105

106106
You can find the most up to date benchmarks in the build artifacts for each build.
107-
108-
## TODO
109-
110-
This project is still in progress, so the public interfaces are subject to change.
111-
112-
- [X] Propose adoption to efcore (seems to be in consideration [#23110](https://github.com/dotnet/efcore/issues/23110)).
113-
- [ ] Publish package as third-party library for the meanwhile.

src/Ainoraz.EFCore.IncludeBuilder/Ainoraz.EFCore.IncludeBuilder.csproj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
<PublishRepositoryUrl>true</PublishRepositoryUrl>
66
</PropertyGroup>
77

8+
<PropertyGroup>
9+
<PackageId>Ainoraz.EFCore.IncludeBuilder</PackageId>
10+
<Authors>ainoraz</Authors>
11+
<Product>$(PackageId)</Product>
12+
<PackageProjectUrl>https://github.com/AinoraZ/EFCore.IncludeBuilder</PackageProjectUrl>
13+
<RepositoryUrl>https://github.com/AinoraZ/EFCore.IncludeBuilder.git</RepositoryUrl>
14+
<RepositoryType>git</RepositoryType>
15+
<PackageTags>efcore;entity;framework;core;include;builder;improved;syntax;</PackageTags>
16+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
17+
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
18+
<Description>Extension library for Entity Framework Core that makes loading navigation properties easier.</Description>
19+
</PropertyGroup>
20+
821
<ItemGroup Label="Package References">
922
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="all" Version="1.1.1" />
1023
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="$(EFCoreVersion)" />

0 commit comments

Comments
 (0)