-
Notifications
You must be signed in to change notification settings - Fork 1
123 lines (101 loc) · 3.16 KB
/
publish.yml
File metadata and controls
123 lines (101 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Publish
# Triggered only when a vX.Y.Z tag is pushed to master.
# To release: merge develop → master, then: git tag v1.0.0 && git push origin v1.0.0
on:
push:
tags:
- 'v*'
env:
DOTNET_VERSION: '10.0.x'
CONFIGURATION: Release
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
jobs:
publish-nuget:
name: Publish to NuGet.org
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history required for MinVer versioning
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: dotnet restore
- name: Build solution
run: dotnet build --configuration ${{ env.CONFIGURATION }} --no-restore
- name: Pack NuGet package
run: >
dotnet pack src/EfCoreKit/EfCoreKit.csproj
--configuration ${{ env.CONFIGURATION }}
--no-build
--output ./artifacts
- name: Publish to NuGet.org
run: >
dotnet nuget push ./artifacts/*.nupkg
--source https://api.nuget.org/v3/index.json
--api-key ${{ secrets.NUGET_API_KEY }}
--skip-duplicate
- name: Publish to GitHub Packages
run: >
dotnet nuget push ./artifacts/*.nupkg
--source https://nuget.pkg.github.com/Clifftech123/index.json
--api-key ${{ secrets.GITHUB_TOKEN }}
--skip-duplicate
create-release:
name: Create GitHub Release
needs: publish-nuget
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore and build
run: dotnet restore && dotnet build --configuration ${{ env.CONFIGURATION }} --no-restore
- name: Pack NuGet package
run: >
dotnet pack src/EfCoreKit/EfCoreKit.csproj
--configuration ${{ env.CONFIGURATION }}
--no-build
--output ./artifacts
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: EfCoreKit v${{ steps.version.outputs.VERSION }}
body: |
## EfCoreKit v${{ steps.version.outputs.VERSION }}
EF Core extensions that eliminate boilerplate.
### Installation
```bash
dotnet add package EfCoreKit
```
### What's included
- Soft delete with global query filters
- Audit trail (CreatedAt, UpdatedAt, CreatedBy, UpdatedBy)
- Repository + Unit of Work pattern
- Specification pattern
- Offset & keyset pagination
- Dynamic filters
- Structured exceptions
files: |
./artifacts/*.nupkg
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}