Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.

Commit 008bfb2

Browse files
committed
Adding all the github actions
1 parent 53e29f6 commit 008bfb2

File tree

7 files changed

+74
-17
lines changed

7 files changed

+74
-17
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ on:
44
push:
55
branches:
66
- master
7-
- release-*
8-
tags:
9-
- '*.*.*'
107
pull_request:
8+
branches:
9+
- master
1110
jobs:
1211
build:
1312
strategy:
@@ -21,9 +20,10 @@ jobs:
2120
- name: Build and Test
2221
run: ./Build.ps1
2322
shell: pwsh
24-
- name: Push
23+
- name: Push to MyGet
2524
env:
26-
MYGET_MEDIATR_CI_API_KEY: ${{ secrets.MYGET_MEDIATR_CI_API_KEY }}
25+
NUGET_URL: https://www.myget.org/F/mediatr-ci/api/v3/index.json
26+
NUGET_API_KEY: ${{ secrets.MYGET_MEDIATR_CI_API_KEY }}
2727
run: ./Push.ps1
2828
shell: pwsh
2929
- name: Artifacts

.github/workflows/pr.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
9+
runs-on: windows-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- name: Build and Test
16+
run: ./Build.ps1
17+
shell: pwsh

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
jobs:
8+
build:
9+
strategy:
10+
fail-fast: false
11+
runs-on: windows-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
- name: Build and Test
18+
run: ./Build.ps1
19+
shell: pwsh
20+
- name: Push to MyGet
21+
env:
22+
NUGET_URL: https://www.myget.org/F/mediatr-ci/api/v3/index.json
23+
NUGET_API_KEY: ${{ secrets.MYGET_MEDIATR_CI_API_KEY }}
24+
run: ./Push.ps1
25+
shell: pwsh
26+
- name: Push to NuGet
27+
env:
28+
NUGET_URL: https://api.nuget.org/v3/index.json
29+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
30+
run: ./Push.ps1
31+
shell: pwsh
32+
- name: Artifacts
33+
uses: actions/upload-artifact@v2
34+
with:
35+
name: artifacts
36+
path: artifacts/**/*

Build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ exec { & dotnet build -c Release }
3232

3333
exec { & dotnet test -c Release -r $artifacts --no-build -l trx --verbosity=normal }
3434

35-
exec { dotnet pack .\src\MediatR.Extensions.Microsoft.DependencyInjection -c Release -o $artifacts --include-symbols -p:SymbolPackageFormat=snupkg --no-build }
35+
exec { dotnet pack .\src\MediatR.Extensions.Microsoft.DependencyInjection -c Release -o $artifacts --no-build }

MediatR.DI.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{1082ED20
88
Build.ps1 = Build.ps1
99
.github\workflows\ci.yml = .github\workflows\ci.yml
1010
Directory.Build.props = Directory.Build.props
11+
.github\workflows\pr.yml = .github\workflows\pr.yml
1112
Push.ps1 = Push.ps1
1213
README.md = README.md
14+
.github\workflows\release.yml = .github\workflows\release.yml
1315
EndProjectSection
1416
EndProject
1517
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediatR.Extensions.Microsoft.DependencyInjection", "src\MediatR.Extensions.Microsoft.DependencyInjection\MediatR.Extensions.Microsoft.DependencyInjection.csproj", "{CD3BCC44-44C0-4A5A-9041-34B558A9FBF2}"

Push.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
$scriptName = $MyInvocation.MyCommand.Name
22
$artifacts = "./artifacts"
33

4-
if ($Env:MYGET_MEDIATR_CI_API_KEY -eq $null) {
5-
Write-Host "${scriptName}: MYGET_MEDIATR_CI_API_KEY is empty or not set. Skipped pushing package(s)."
4+
if ([string]::IsNullOrEmpty($Env:NUGET_API_KEY)) {
5+
Write-Host "${scriptName}: NUGET_API_KEY is empty or not set. Skipped pushing package(s)."
66
} else {
77
Get-ChildItem $artifacts -Filter "*.nupkg" | ForEach-Object {
88
Write-Host "$($scriptName): Pushing $($_.Name)"
9-
dotnet nuget push $_ --source https://www.myget.org/F/mediatr-ci/api/v3/index.json --api-key $Env:MYGET_MEDIATR_CI_API_KEY
9+
dotnet nuget push $_ --source $Env:NUGET_URL --api-key $Env:NUGET_API_KEY
1010
if ($lastexitcode -ne 0) {
1111
throw ("Exec: " + $errorMessage)
1212
}

src/MediatR.Extensions.Microsoft.DependencyInjection/MediatR.Extensions.Microsoft.DependencyInjection.csproj

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
<AssemblyName>MediatR.Extensions.Microsoft.DependencyInjection</AssemblyName>
88
<PackageId>MediatR.Extensions.Microsoft.DependencyInjection</PackageId>
99
<PackageTags>mediator;request;response;queries;commands;notifications</PackageTags>
10-
<PackageIconUrl>https://raw.githubusercontent.com/jbogard/MediatR/master/assets/logo/gradient_128x128.png</PackageIconUrl>
11-
<PackageProjectUrl>https://github.com/jbogard/MediatR.Extensions.Microsoft.DependencyInjection</PackageProjectUrl>
12-
<RepositoryType>git</RepositoryType>
13-
<RepositoryUrl>git://github.com/jbogard/MediatR.Extensions.Microsoft.DependencyInjection</RepositoryUrl>
1410
<SignAssembly>true</SignAssembly>
1511
<AssemblyOriginatorKeyFile>..\..\MediatR.snk</AssemblyOriginatorKeyFile>
1612
<PackageIcon>gradient_128x128.png</PackageIcon>
13+
14+
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
15+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
16+
<IncludeSymbols>true</IncludeSymbols>
17+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
18+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
19+
<Deterministic>true</Deterministic>
20+
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
1721
</PropertyGroup>
1822

1923
<ItemGroup>
@@ -23,10 +27,8 @@
2327
<ItemGroup>
2428
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" />
2529
<PackageReference Include="MediatR" Version="8.0.0" />
26-
<PackageReference Include="MinVer" Version="2.3.0">
27-
<PrivateAssets>all</PrivateAssets>
28-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
29-
</PackageReference>
30+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
31+
<PackageReference Include="MinVer" Version="2.3.0" PrivateAssets="All" />
3032
</ItemGroup>
3133

3234
</Project>

0 commit comments

Comments
 (0)