-
-
Notifications
You must be signed in to change notification settings - Fork 48
55 lines (54 loc) · 2.64 KB
/
release.yml
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
name: Pack and release
on:
push:
# Sequence of patterns matched against refs/heads
branches:
- "main"
- "dev*"
# Sequence of patterns matched against refs/tags
tags:
- "*"
jobs:
pack_and_release:
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
steps:
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: "5.x"
- name: Checkout source
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
- name: Install dependencies
run: dotnet restore Mediator.Net.sln
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Pack
run: |
dotnet pack "src\Mediator.Net" -c Release --no-build -o artifacts -p:PackageVersion=`echo ${{ steps.gitversion.outputs.fullSemVer }}|sed 's^+^-^g'`
dotnet pack "src\Mediator.Net.Autofac" -c Release --no-build -o artifacts -p:PackageVersion=`echo ${{ steps.gitversion.outputs.fullSemVer }}|sed 's^+^-^g'`
dotnet pack "src\Mediator.Net.StructureMap" -c Release --no-build -o artifacts -p:PackageVersion=`echo ${{ steps.gitversion.outputs.fullSemVer }}|sed 's^+^-^g'`
dotnet pack "src\Mediator.Net.Ninject" -c Release --no-build -o artifacts -p:PackageVersion=`echo ${{ steps.gitversion.outputs.fullSemVer }}|sed 's^+^-^g'`
dotnet pack "src\Mediator.Net.SimpleInjector" -c Release --no-build -o artifacts -p:PackageVersion=`echo ${{ steps.gitversion.outputs.fullSemVer }}|sed 's^+^-^g'`
dotnet pack "src\Mediator.Net.Middlewares.Serilog" -c Release --no-build -o artifacts -p:PackageVersion=`echo ${{ steps.gitversion.outputs.fullSemVer }}|sed 's^+^-^g'`
dotnet pack "src\Mediator.Net.TestUtil" -c Release --no-build -o artifacts -p:PackageVersion=`echo ${{ steps.gitversion.outputs.fullSemVer }}|sed 's^+^-^g'`
dotnet pack "src\Mediator.Net.MicrosoftDependencyInjection" -c Release --no-build -o artifacts -p:PackageVersion=`echo ${{ steps.gitversion.outputs.fullSemVer }}|sed 's^+^-^g'`
- name: Push to nuget
run: dotnet nuget push **/artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY} --skip-duplicate
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}