-
Notifications
You must be signed in to change notification settings - Fork 8
130 lines (102 loc) · 6.08 KB
/
build-test-and-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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Build, Test, and Release
on:
push:
branches:
- main
jobs:
build_test_and_release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }}
fetch-depth: '0'
- name: Install Versionize
run: dotnet tool install --global Versionize
- name: Setup git
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Versionize Release
id: versionize
run: versionize --exit-insignificant-commits
continue-on-error: true
- name: No release required
if: steps.versionize.outcome != 'success'
run: echo "Skipping publishing. No release required."
- name: Setup .NET Core
if: steps.versionize.outcome == 'success'
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.101
- name: Install dependencies
if: steps.versionize.outcome == 'success'
run: dotnet restore Firebend.AutoCrud.sln
- name: Build
if: steps.versionize.outcome == 'success'
run: dotnet build Firebend.AutoCrud.sln --configuration Release --no-restore
- name: Test
if: steps.versionize.outcome == 'success'
run: dotnet test Firebend.AutoCrud.sln --logger GitHubActions --no-restore --verbosity normal --filter FullyQualifiedName\!~IntegrationTests
- name: Pack Core
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.Core/Firebend.AutoCrud.Core.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Pack EntityFramework
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.EntityFramework/Firebend.AutoCrud.EntityFramework.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Pack EntityFramework Elastic
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.EntityFramework.Elastic/Firebend.AutoCrud.EntityFramework.Elastic.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Pack Generator
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.Generator/Firebend.AutoCrud.Generator.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Pack Mongo
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.Mongo/Firebend.AutoCrud.Mongo.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Pack Web
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.DomainEvents.MassTransit/Firebend.AutoCrud.DomainEvents.MassTransit.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Pack Domain Events MassTransit
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.Web/Firebend.AutoCrud.Web.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Pack Change Tracking
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.ChangeTracking/Firebend.AutoCrud.ChangeTracking.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Pack Change Tracking Ef
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.ChangeTracking.EntityFramework/Firebend.AutoCrud.ChangeTracking.EntityFramework.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Pack Change Tracking Mongo
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.ChangeTracking.Mongo/Firebend.AutoCrud.ChangeTracking.Mongo.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Pack Change Tracking Web
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.ChangeTracking.Web/Firebend.AutoCrud.ChangeTracking.Web.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Pack IO
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.Io/Firebend.AutoCrud.Io.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Pack IO Web
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.Io.Web/Firebend.AutoCrud.Io.Web.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Pack Custom Fields EF
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.CustomFields.EntityFramework/Firebend.AutoCrud.CustomFields.EntityFramework.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Pack Custom Fields Mongo
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.CustomFields.Mongo/Firebend.AutoCrud.CustomFields.Mongo.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Pack Custom Fields Web
if: steps.versionize.outcome == 'success'
run: dotnet pack Firebend.AutoCrud.CustomFields.Web/Firebend.AutoCrud.CustomFields.Web.csproj --no-build -c Release --include-symbols -p:SymbolPackageFormat=snupkg -o .
- name: Publish Nuget Packages
if: steps.versionize.outcome == 'success'
run: dotnet nuget push *.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source "https://api.nuget.org/v3/index.json" --skip-duplicate
- name: Push version changes
if: steps.versionize.outcome == 'success'
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }}
branch: main
tags: true
force: true
unprotect_reviews: true
sleep: 5