-
Notifications
You must be signed in to change notification settings - Fork 117
113 lines (99 loc) · 3.25 KB
/
build.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Automatonymous
env:
AUTOMATONYMOUS_VERSION: 5.1.4
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true
on:
push:
paths:
- 'src/**'
- 'tests/**'
- 'Automatonymous.sln'
- 'Directory.Build.props'
- '**/build.yml'
pull_request:
paths:
- 'src/**'
- 'tests/**'
- 'Automatonymous.sln'
- 'Directory.Build.props'
- '**/build.yml'
workflow_dispatch:
jobs:
compile:
name: Compile and Unit Tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: Restore NuGet packages
run: dotnet restore
working-directory: ./
- name: Build
run: dotnet build -c Release --no-restore
working-directory: ./
- name: Test
run: dotnet test -c Release --no-build
working-directory: tests/Automatonymous.Tests
- name: Test NHibernate
run: dotnet test -c Release --no-build
working-directory: tests/Automatonymous.NHibernateIntegration.Tests
calc-version:
name: Calculate Version
runs-on: ubuntu-latest
needs:
- compile
outputs:
version: ${{ steps.v.outputs.version }}
steps:
- id: v
run: |
if [ "${{ github.ref }}" = 'refs/heads/master' ]; then
echo "::set-output name=version::${AUTOMATONYMOUS_VERSION}"
else
echo "::set-output name=version::${AUTOMATONYMOUS_VERSION}-develop.${{ github.run_number }}"
fi
publish:
name: Build and Publish NuGets
runs-on: ubuntu-latest
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') && github.repository == 'MassTransit/Automatonymous' && success()
needs:
- calc-version
steps:
- name: Version Output Check
run: |
echo "${{ needs.calc-version.outputs.version }}"
- name: Check out code
uses: actions/checkout@v2
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: Build and Publish Automatonymous
uses: drusellers/publish-nuget@master
with:
project-file-path: src/Automatonymous/Automatonymous.csproj
version: ${{ needs.calc-version.outputs.version }}
tag-commit: false
nuget-key: ${{secrets.NUGET_API_KEY}}
include-symbols: true
- name: Build and Publish NHibernate
uses: drusellers/publish-nuget@master
with:
project-file-path: src/Automatonymous.NHibernateIntegration/Automatonymous.NHibernateIntegration.csproj
version: ${{ needs.calc-version.outputs.version }}
tag-commit: false
nuget-key: ${{secrets.NUGET_API_KEY}}
include-symbols: true
- name: Build and Publish Visualizer
uses: drusellers/publish-nuget@master
with:
project-file-path: src/Automatonymous.Visualizer/Automatonymous.Visualizer.csproj
version: ${{ needs.calc-version.outputs.version }}
tag-commit: false
nuget-key: ${{secrets.NUGET_API_KEY}}
include-symbols: true