forked from mirrors/jellyfin-plugin-sso
7028cfe11d
ci/woodpecker/push/ci Pipeline was successful
Build and test the plugin on every push and pull request, and give local builds the same commands plus the house version-bump targets.
36 lines
1.1 KiB
Makefile
36 lines
1.1 KiB
Makefile
.PHONY: build test lint clean patch minor major
|
|
|
|
SLN ?= SSO-Auth.sln
|
|
|
|
build:
|
|
dotnet restore $(SLN)
|
|
dotnet build $(SLN) -c Release --no-restore --warnaserror
|
|
|
|
test: build
|
|
dotnet test $(SLN) -c Release --no-build --verbosity minimal
|
|
|
|
lint:
|
|
dotnet format $(SLN) --verify-no-changes
|
|
|
|
clean:
|
|
dotnet clean $(SLN) -c Release || true
|
|
rm -rf SSO-Auth/bin SSO-Auth/obj SSO-Auth/Lib/bin SSO-Auth/Lib/obj
|
|
|
|
_LATEST := $(shell git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$$' | head -1)
|
|
_BASE := $(if $(_LATEST),$(_LATEST),v0.0.0)
|
|
_MAJ := $(shell echo $(_BASE) | sed 's/^v//' | cut -d. -f1)
|
|
_MIN := $(shell echo $(_BASE) | sed 's/^v//' | cut -d. -f2)
|
|
_PAT := $(shell echo $(_BASE) | sed 's/^v//' | cut -d. -f3)
|
|
|
|
patch:
|
|
@NEW=v$(_MAJ).$(_MIN).$(shell expr $(_PAT) + 1); \
|
|
git tag $$NEW && echo "Tagged $$NEW" && git push origin $$NEW
|
|
|
|
minor:
|
|
@NEW=v$(_MAJ).$(shell expr $(_MIN) + 1).0; \
|
|
git tag $$NEW && echo "Tagged $$NEW" && git push origin $$NEW
|
|
|
|
major:
|
|
@NEW=v$(shell expr $(_MAJ) + 1).0.0; \
|
|
git tag $$NEW && echo "Tagged $$NEW" && git push origin $$NEW
|