-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (64 loc) · 3.37 KB
/
dotnetcore-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
name: .NET Core Build
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
DOTNET_VERSION: 'net7.0'
DOTNET_FRAMEWORK_VERSION: '7.x'
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET ${{ env.DOTNET_FRAMEWORK_VERSION }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_FRAMEWORK_VERSION }}
- name: Clean
run: dotnet clean ./src/SqlBuildManager.Console/sbm.csproj --configuration Release && dotnet nuget locals all --clear
- name: Clean
run: dotnet clean ./src/SqlSync/SQLSync.csproj --configuration Release && dotnet nuget locals all --clear
- name: Restore and build console app
run: dotnet build ./src/SqlBuildManager.Console/sbm.csproj --configuration Release -f ${{ env.DOTNET_VERSION }}
- name: Restore and build desktop app
run: dotnet build ./src/SqlSync/SQLSync.csproj --configuration Release -f ${{ env.DOTNET_VERSION }}-windows
# Run tests
- name: Run SqlBuildManager.Console.UnitTest
run: dotnet test ./src/SqlBuildManager.Console.UnitTest/SqlBuildManager.Console.UnitTest.csproj --configuration Release
- name: Run SqlBuildManager.Enterprise.UnitTest
run: dotnet test ./src/SqlBuildManager.Enterprise.UnitTest/SqlBuildManager.Enterprise.UnitTest.csproj --configuration Release
- name: Run SqlBuildManager.ScriptHandling.UnitTest
run: dotnet test ./src/SqlBuildManager.ScriptHandling.UnitTest/SqlBuildManager.ScriptHandling.UnitTest.csproj --configuration Release
- name: Run SqlSync.Connection.UnitTest
run: dotnet test ./src/SqlSync.Connection.UnitTest/SqlSync.Connection.UnitTest.csproj --configuration Release
- name: Run SqlSync.ObjectScript.UnitTest
run: dotnet test ./src/SqlSync.ObjectScript.UnitTest/SqlSync.ObjectScript.UnitTest.csproj --configuration Release
- name: Run SqlSync.SqlBuild.UnitTest
run: dotnet test ./src/SqlSync.SqlBuild.UnitTest/SqlSync.SqlBuild.UnitTest.csproj --configuration Release
# .NET 7.0 pubish
- name: Publish the Windows desktop app
run: dotnet publish ./src/SqlSync/SqlSync.csproj -r win-x64 --configuration Release -f ${{ env.DOTNET_VERSION }}-windows
- name: Publish the Windows CLI app
run: dotnet publish ./src/SqlBuildManager.Console/sbm.csproj -r win-x64 --configuration Release -f ${{ env.DOTNET_VERSION }} --self-contained
- name: Publish the Linux CLI app
run: dotnet publish ./src/SqlBuildManager.Console/sbm.csproj -r linux-x64 --configuration Release -f ${{ env.DOTNET_VERSION }} --self-contained
# .NET 7 artifacts
- name: Upload a Build Artifact sbm-windows
uses: actions/upload-artifact@v2
with:
name: sbm-windows-${{ env.DOTNET_VERSION }}
path: "./src/SqlBuildManager.Console/bin/Release/${{ env.DOTNET_VERSION }}/win-x64/publish"
- name: Upload a Build Artifact sbm-linux
uses: actions/upload-artifact@v2
with:
name: sbm-linux-${{ env.DOTNET_VERSION }}
path: "./src/SqlBuildManager.Console/bin/Release/${{ env.DOTNET_VERSION }}/linux-x64/publish"
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
name: SqlBuildManager Desktop ${{ env.DOTNET_VERSION }}
path: "./src/SqlSync/bin/Release/${{ env.DOTNET_VERSION }}-windows/win-x64/publish"