Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Commit 4aa249f

Browse files
Add NuGet push action
1 parent 1930eee commit 4aa249f

5 files changed

Lines changed: 47 additions & 76 deletions

File tree

.github/workflows/build-and-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build & Tests
33
on:
44
push:
55
branches:
6-
- main
6+
- '*'
77
pull_request:
88
branches:
99
- '*'

.github/workflows/build-artifacts.yml

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build Artifacts
33
on:
44
push:
55
branches:
6-
- main
6+
- '*'
77
pull_request:
88
branches:
99
- '*'
@@ -22,55 +22,10 @@ jobs:
2222
uses: ./.github/actions/setup-env
2323

2424
- name: Build Artifacts
25-
run: dotnet pack ./NG.Mediator/NG.Mediator.csproj -c Release -o "./artifacts"
25+
run: dotnet pack ./NG.Mediator/NG.Mediator.csproj --configuration Release --output "./artifacts" --include-source
2626

2727
- name: Artifacts
2828
uses: actions/upload-artifact@v4
2929
with:
3030
name: 'artifacts.zip'
3131
path: ./artifacts/*
32-
33-
#on:
34-
# push:
35-
# tags:
36-
# - '*.*.*'
37-
#jobs:
38-
# build:
39-
# strategy:
40-
# matrix:
41-
# os: [ubuntu-latest]
42-
# fail-fast: false
43-
# runs-on: ubuntu-latest
44-
# steps:
45-
# - name: Checkout
46-
# uses: actions/checkout@v4
47-
# with:
48-
# fetch-depth: 0
49-
# - name: Setup dotnet 6.0
50-
# uses: actions/setup-dotnet@v4
51-
# with:
52-
# dotnet-version: '6.0.x'
53-
# - name: Setup dotnet 8.0
54-
# uses: actions/setup-dotnet@v4
55-
# with:
56-
# dotnet-version: '8.0.100'
57-
# - name: Build and Test
58-
# run: ./Build.ps1
59-
# shell: pwsh
60-
# - name: Push to MyGet
61-
# env:
62-
# NUGET_URL: https://www.myget.org/F/NG.Mediator-ci/api/v3/index.json
63-
# NUGET_API_KEY: ${{ secrets.MYGET_NG.Mediator_CI_API_KEY }}
64-
# run: ./Push.ps1
65-
# shell: pwsh
66-
# - name: Push to NuGet
67-
# env:
68-
# NUGET_URL: https://api.nuget.org/v3/index.json
69-
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
70-
# run: ./Push.ps1
71-
# shell: pwsh
72-
# - name: Artifacts
73-
# uses: actions/upload-artifact@v4
74-
# with:
75-
# name: artifacts
76-
# path: artifacts/**/*

.github/workflows/build-nuget.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build NuGet Package
2+
3+
on:
4+
push:
5+
branches:
6+
- release
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Setup Environment
18+
uses: ./.github/actions/setup-env
19+
20+
- name: Build Artifacts
21+
run: dotnet pack ./NG.Mediator/NG.Mediator.csproj --configuration Release --output "./artifacts" --include-source
22+
23+
- name: Push to NuGet
24+
env:
25+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
26+
run: dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY

NG.Mediator/NG.Mediator.csproj

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,41 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
32
<PropertyGroup>
4-
<Authors>Nickolas Gupton and MediatR contributors up to commit 3f5c3eca8db07e3791f638243bbb879ef847c09e</Authors>
5-
<Description>Simple, unambitious mediator implementation in .NET</Description>
6-
<TargetFrameworks>net9.0</TargetFrameworks>
3+
<!-- Build info -->
4+
<TargetFramework>net9.0</TargetFramework>
5+
<LangVersion>latest</LangVersion>
6+
<OutputType>Library</OutputType>
77
<Nullable>enable</Nullable>
8+
<ImplicitUsings>enable</ImplicitUsings>
9+
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
10+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
11+
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
12+
<Deterministic>true</Deterministic>
13+
14+
<!-- Assembly/NuGet info -->
15+
<Version>0.0.1</Version>
16+
<Authors>Nickolas Gupton and MediatR contributors up to commit 3f5c3eca8db07e3791f638243bbb879ef847c09e</Authors>
17+
<RepositoryUrl>https://github.com/CorruptComputer/NG.Mediator</RepositoryUrl>
18+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
19+
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
20+
<SourceControlInformationFeatureSupported>true</SourceControlInformationFeatureSupported>
21+
<SourceRevisionId>main</SourceRevisionId>
822
<Features>strict</Features>
923
<PackageTags>mediator;request;response;queries;commands;notifications</PackageTags>
10-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1124
<PackageReadmeFile>README.md</PackageReadmeFile>
12-
<MinVerTagPrefix>v</MinVerTagPrefix>
1325
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
1426
<PublishRepositoryUrl>true</PublishRepositoryUrl>
1527
<IncludeSymbols>true</IncludeSymbols>
1628
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
1729
<EmbedUntrackedSources>true</EmbedUntrackedSources>
18-
<Deterministic>true</Deterministic>
19-
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
2030
</PropertyGroup>
2131

2232
<ItemGroup>
23-
<PackageReference Include="IsExternalInit" Version="1.0.3">
24-
<PrivateAssets>all</PrivateAssets>
25-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
26-
</PackageReference>
2733
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
2834
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
2935
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
30-
<PackageReference Include="MinVer" Version="6.0.0" PrivateAssets="All" />
3136
</ItemGroup>
3237

3338
<ItemGroup>
3439
<None Include="..\README.md" Pack="true" PackagePath="\" />
3540
</ItemGroup>
36-
3741
</Project>

Push.ps1

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)