-
Notifications
You must be signed in to change notification settings - Fork 65
122 lines (95 loc) · 5.65 KB
/
dotnet-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
113
114
115
116
117
118
119
120
121
122
name: Package up.
on:
push:
branches: "**"
pull_request:
branches: "**"
jobs:
build:
runs-on: windows-latest
env:
CONFIG: 'Release'
SOLUTION_FILE: './uSync.sln'
OUT_FOLDER: './build.out/'
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.x"
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Determine Version with GitVersion (MSBuild in Proj will do this)
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
configFilePath: ./GitVersion.yml
- name: Restore npm
uses: actions/setup-node@v3
with:
node-version: '20.x'
cache: 'npm'
- run: npm install
# install and run the packages for our assets folder.
- name: Build Management client
run: |
npm run install-client
npm run build-client
- name: Display GitVersion SemVer
run: |
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
# ------------------------
# actual builds / packages
# ------------------------
# use nuget cache.
- uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashfiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Restore Dependencies
run: dotnet restore ./uSync/uSync.csproj
- name: tests
run: dotnet test ./uSync.Tests/uSync.Tests.csproj
- name: Generate AppSettings Schema
run: dotnet run -c ${{env.Config}} --project ./uSync.SchemaGenerator/uSync.SchemaGenerator.csproj
- name: Build uSync.Core
run: dotnet pack ./uSync.Core/uSync.Core.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}
- name: Build uSync.Community.Contrib
run: dotnet pack ./uSync.Community.Contrib/uSync.Community.Contrib.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}
- name: Build uSync.DataTypeSerializers
run: dotnet pack ./uSync.Community.DataTypeSerializers/uSync.Community.DataTypeSerializers.csproj -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}
- name: Build uSync.BackOffice
run: dotnet pack ./uSync.BackOffice/uSync.BackOffice.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}
- name: Build uSync.Backoffice.Management.Api
run: dotnet pack ./uSync.BackOffice.Management.Api/uSync.BackOffice.Management.Api.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}
- name: Build uSync.Backoffice.Management.Client
run: dotnet pack ./uSync.BackOffice.Management.Client/uSync.BackOffice.Management.Client.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}
- name: Build uSync.BackOfficeTargets
run: dotnet pack ./uSync.BackOffice.Targets/uSync.BackOffice.Targets.csproj -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}
- name: Build uSync
run: dotnet pack ./uSync/uSync.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.fullSemVer}}
- name: Upload nuget file as build artifact
uses: actions/upload-artifact@v2
with:
name: Nuget Build Output
path: ${{env.OUT_FOLDER}}
# can't use wilecards with dotnet nuget command
- name: Push to Jumoo GitHub Nuget Repo
if: ${{ github.event_name != 'pull_request' }}
run: |
dotnet nuget push ./build.out/uSync.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/uSync.Core.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/uSync.BackOffice.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/uSync.BackOffice.Management.Api.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/uSync.BackOffice.Management.Client.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/uSync.BackOffice.Targets.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/uSync.Community.Contrib.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}
dotnet nuget push ./build.out/uSync.Community.DataTypeSerializers.${{steps.gitversion.outputs.fullSemVer}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/kevinjump/index.json --api-key ${{ github.token }}