Skip to content

Commit f867b50

Browse files
committed
Adding additional workflows
1 parent 2bb14e9 commit f867b50

File tree

7 files changed

+82
-12
lines changed

7 files changed

+82
-12
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ 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:
1413
fail-fast: false
15-
runs-on: windows-latest
14+
runs-on: windowws-latest
1615
steps:
1716
- name: Checkout
1817
uses: actions/checkout@v2
@@ -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: ubuntu-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/**/*

Directory.Build.props

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
<Project>
22
<PropertyGroup>
3-
<Authors>Jimmy Bogard</Authors>
43
<LangVersion>latest</LangVersion>
54
<NoWarn>$(NoWarn);1701;1702;1591</NoWarn>
65
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
7-
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
8-
<MinVerTagPrefix>v</MinVerTagPrefix>
96
</PropertyGroup>
107
</Project>

MediatR.sln

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
44
VisualStudioVersion = 16.0.29613.14
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{6267E2ED-942C-497D-BFC9-B3CE0AFC276F}"
7+
ProjectSection(SolutionItems) = preProject
8+
src\Directory.Build.props = src\Directory.Build.props
9+
EndProjectSection
710
EndProject
811
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{962C5ACA-AB2B-4E9B-9EBB-7E7EE28CDBB1}"
912
EndProject
@@ -37,8 +40,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
3740
Build.ps1 = Build.ps1
3841
.github\workflows\ci.yml = .github\workflows\ci.yml
3942
Directory.Build.props = Directory.Build.props
43+
.github\workflows\pr.yml = .github\workflows\pr.yml
4044
Push.ps1 = Push.ps1
4145
README.md = README.md
46+
.github\workflows\release.yml = .github\workflows\release.yml
4247
EndProjectSection
4348
EndProject
4449
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediatR.Examples.Unity", "samples\MediatR.Examples.Unity\MediatR.Examples.Unity.csproj", "{E6C51E44-59B4-4F4F-AFB3-4032CDDEF07A}"

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 ([string]::IsNullOrEmpty($Env:MYGET_MEDIATR_CI_API_KEY)) {
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/Directory.Build.props

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project>
2+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
3+
<PropertyGroup>
4+
<Authors>Jimmy Bogard</Authors>
5+
<Copyright>Jimmy Bogard</Copyright>
6+
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
7+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
8+
<IncludeSymbols>true</IncludeSymbols>
9+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
10+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
11+
<Deterministic>true</Deterministic>
12+
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">True</ContinuousIntegrationBuild>
13+
<MinVerTagPrefix>v</MinVerTagPrefix>
14+
</PropertyGroup>
15+
</Project>

0 commit comments

Comments
 (0)