aboutsummaryrefslogtreecommitdiff
path: root/Module.Taskfile.yaml
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-08-01 17:59:22 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2023-08-01 17:59:22 -0400
commitb27a734a56f07c2e15518364c4cc3cef0b13a1e2 (patch)
tree2df5797b34339b95743f983ba74c5eddf2865c99 /Module.Taskfile.yaml
parentf0c2337358fc43ad9c79294c539c4ddec4280011 (diff)
build config added
Diffstat (limited to 'Module.Taskfile.yaml')
-rw-r--r--Module.Taskfile.yaml68
1 files changed, 68 insertions, 0 deletions
diff --git a/Module.Taskfile.yaml b/Module.Taskfile.yaml
new file mode 100644
index 0000000..88565f9
--- /dev/null
+++ b/Module.Taskfile.yaml
@@ -0,0 +1,68 @@
+# https://taskfile.dev
+
+#Called by the vnbuild system to produce builds for my website
+#https://www.vaughnnugent.com/resources/software
+
+#This taskfile performs the build operations for a module, it handles
+#git code updates, msbuild on solutions, and sleet NuGet feed pushes.
+
+#this file must be in the same directory as the solution file
+
+version: '3'
+
+vars:
+ INT_DIR: '{{.SCRATCH_DIR}}/obj/{{.MODULE_NAME}}/'
+ MS_ARGS: '/p:RunAnalyzersDuringBuild=false /p:IntermediateOutputPath="{{.INT_DIR}}" /p:UseCommonOutputDirectory=true /p:BuildInParallel=true /p:MultiProcessorCompilation=true'
+ PACK_OUT: '{{.OUTPUT_DIR}}/{{.HEAD_SHA}}/pkg'
+
+tasks:
+
+#called by build pipeline to sync repo
+ update:
+ cmds:
+ - git remote update
+ - git reset --hard
+ - git pull origin {{.BRANCH_NAME}} --verify-signatures
+
+#called by build pipeline to build module
+ build:
+ cmds:
+ - echo "building module {{.MODULE_NAME}}"
+
+ #re-write semver after hard reset, before build
+ - dotnet-gitversion.exe /updateprojectfiles
+
+ #build debug mode first
+ - task: build_debug
+ - task: build_release
+
+ postbuild_success:
+ cmds:
+ #push packages to the sleet feed (feed path is vnbuild global)
+ - powershell -Command 'sleet push "{{.PACK_OUT}}/debug/" --source debug --config "{{.SLEET_CONFIG_PATH}}" --force'
+ - powershell -Command 'sleet push "{{.PACK_OUT}}/release/" --source release --config "{{.SLEET_CONFIG_PATH}}" --force'
+
+ postbuild_failed:
+ cmds:
+ - echo "postbuild failed {{.MODULE_NAME}}"
+
+#called by build pipeline to clean module
+ clean:
+ cmds:
+ #clean solution
+ - dotnet clean /p:BuildInParallel=true /p:MultiProcessorCompilation=true
+
+
+#Internal tasks
+ build_debug:
+ internal: true
+ cmds:
+ - powershell -Command 'dotnet publish -c debug {{.MS_ARGS}}'
+ - powershell -Command 'dotnet pack -c debug {{.MS_ARGS}} -o "{{.PACK_OUT}}/debug/"'
+
+ build_release:
+ internal: true
+ cmds:
+ - powershell -Command 'dotnet publish -c release {{.MS_ARGS}}'
+ - powershell -Command 'dotnet pack -c release {{.MS_ARGS}} -o "{{.PACK_OUT}}/release/"'
+ \ No newline at end of file