-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile
51 lines (38 loc) · 1.14 KB
/
Makefile
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
.PHONY: help build run release test clean
-include secrets.mk
help:
$(info ${HELP_MESSAGE})
@exit 0
build:
dotnet build MiHomeLib -c Debug
run:
dotnet run --project MiHomeConsole
test:
dotnet test MiHomeUnitTests
clean:
dotnet clean
release:
dotnet build MiHomeLib -c Release
publish-nuget: check-version check-secrets
dotnet nuget push MiHomeLib/bin/Release/MiHomeLib.${v}.nupkg --api-key $(NUGET_SECRET) --source https://api.nuget.org/v3/index.json
publish-github: check-version check-secrets
dotnet nuget push MiHomeLib/bin/Release/MiHomeLib.${v}.nupkg --api-key $(GITHUB_SECRET) --source https://nuget.pkg.github.com/sergey-brutsky/index.json
check-version:
ifndef v
$(error Parameter 'v' is undefined. Must be valid nuget package version)
endif
check-secrets:
ifeq (,$(wildcard secrets.mk))
$(error secrets.mk doesnt exist, you need to download it first !)
endif
define HELP_MESSAGE
Usage: $ make [TARGETS]
TARGETS
build Build app
release Build release
test Run unit tests
run Run console application
clean Clean
publish-nuget Upload nuget package to nuget.org
publish-github Upload nuget package to github packages repo
endef