Add Woodpecker CI and Makefile #1

Merged
benvin merged 2 commits from benvin/ci into main 2026-09-19 22:23:10 +10:00
2 changed files with 62 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
when:
- event: pull_request
Review

Not required on push, only pull request

Not required on push, only pull request
steps:
# Restore, build and test in one step so the NuGet cache stays on the step's
# own ephemeral storage instead of the workspace volume.
- name: build-test
image: mcr.microsoft.com/dotnet/sdk:10.0
environment:
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
DOTNET_NOLOGO: "1"
commands:
- dotnet --info
- dotnet restore SSO-Auth.sln
- dotnet build SSO-Auth.sln -c Release --no-restore --warnaserror
# No test project exists yet; this is a no-op until one lands.
- dotnet test SSO-Auth.sln -c Release --no-build --verbosity minimal
backend_options:
kubernetes:
serviceAccountName: jellyfin-plugin-sso
resources:
requests:
memory: 1Gi
cpu: 1
limits:
memory: 4Gi
cpu: 2
+35
View File
@@ -0,0 +1,35 @@
.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