Skip to content

Commit 9d8eb15

Browse files
committed
Add CI
1 parent 7e9cd8a commit 9d8eb15

3 files changed

Lines changed: 51 additions & 0 deletions

File tree

src/.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
branches:
7+
- main
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 15
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
- name: Build
16+
run: dotnet build --configuration Release
17+
- name: Test
18+
run: dotnet test --configuration Release --no-build

src/.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
on:
2+
push:
3+
tags:
4+
- "v[0-9]+.[0-9]+.[0-9]+"
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
timeout-minutes: 15
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: Verify commit exists in origin/main
13+
run: |
14+
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
15+
git branch --remote --contains | grep origin/main
16+
- name: Set VERSION variable from tag
17+
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
18+
- name: Build
19+
run: dotnet build --configuration Release /p:Version=${VERSION}
20+
- name: Test
21+
run: dotnet test --configuration Release /p:Version=${VERSION} --no-build
22+
- name: Pack
23+
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .
24+
- name: Push
25+
run: dotnet nuget push EntityFramework.Extensions.AddQueryFilter.${VERSION}.nupkg --source https://nuget.pkg.github.com/HerveZu/index.json --api-key ${GITHUB_TOKEN}
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

src/EntityFramework.Extensions.AddQueryFilter.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
88

9+
<PropertyGroup>
10+
<PackageId>EntityFramework.Extensions.AddQueryFilter</PackageId>
11+
<RepositoryType>git</RepositoryType>
12+
<RepositoryUrl>https://github.com/HerveZu/EntityFramework.Extensions.AddQueryFilter</RepositoryUrl>
13+
</PropertyGroup>
14+
915
<ItemGroup>
1016
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0" />
1117
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.8" />

0 commit comments

Comments
 (0)