Skip to content

Commit a1d8c44

Browse files
committed
ci: add nuget package metadata and automated publishing workflow
1 parent d0d6e23 commit a1d8c44

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish Contracts to NuGet
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'src/DotCruz.Notifications.Contracts/**'
8+
workflow_dispatch:
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: 10.0.x
20+
21+
- name: Build and Pack
22+
run: dotnet pack src/DotCruz.Notifications.Contracts/DotCruz.Notifications.Contracts.csproj -c Release -o out
23+
24+
- name: Push to NuGet.org
25+
run: dotnet nuget push out/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}

src/DotCruz.Notifications.Contracts/DotCruz.Notifications.Contracts.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7+
<IsPackable>true</IsPackable>
8+
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
9+
<PackageId>DotCruz.Notifications.Contracts</PackageId>
10+
<Version>1.0.0</Version>
11+
<Authors>Matheus Felipe @matheusfsc28</Authors>
12+
<Company>DotCruz</Company>
13+
<Description>Contratos, enums e mensagens de integração para o serviço de Notificações da DotCruz.</Description>
14+
<RepositoryUrl>https://github.com/matheusfsc28/DotCruz.Notifications</RepositoryUrl>
715
</PropertyGroup>
816

917
</Project>

0 commit comments

Comments
 (0)