aboutsummaryrefslogtreecommitdiff
path: root/Taskfile.yaml
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-08-01 18:39:13 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2023-08-01 18:39:13 -0400
commit67773b085cac372dc6cc63bc9b5d1292c650d071 (patch)
tree682e605dc52026f7a5e80b32a8ac06066ee14c41 /Taskfile.yaml
parenteffb0538dbe26553992b883472df5bba4f46a4d3 (diff)
Latest updates, build configurations, and native compression
Diffstat (limited to 'Taskfile.yaml')
-rw-r--r--Taskfile.yaml75
1 files changed, 75 insertions, 0 deletions
diff --git a/Taskfile.yaml b/Taskfile.yaml
new file mode 100644
index 0000000..b16b082
--- /dev/null
+++ b/Taskfile.yaml
@@ -0,0 +1,75 @@
+# https://taskfile.dev
+
+#Called by the vnbuild system to produce builds for my website
+#https://www.vaughnnugent.com/resources/software
+
+#This taskfile is called from the root of a project that is being built
+#and the purpose of this taskfile is to package up the output of a build
+#from the solution file, and package it up into a tgz files for distribution
+
+version: '3'
+
+vars:
+ TARGET: '{{.USER_WORKING_DIR}}/bin'
+ RELEASE_DIR: "./bin/release/{{.TARGET_FRAMEWORK}}/publish"
+ SOURCE_OUT: "{{.USER_WORKING_DIR}}/bin/source"
+
+tasks:
+
+ #when build succeeds, archive the output into a tgz
+ postbuild_success:
+ dir: '{{.USER_WORKING_DIR}}'
+ cmds:
+ #pack up source code
+ - task: packsource
+
+ #run post in debug mode
+ - task: postbuild
+ vars: { BUILD_MODE: debug }
+
+ #remove uncessary files from the release dir
+ - powershell -Command "Get-ChildItem -Recurse '{{.RELEASE_DIR}}/' -Include *.pdb,*.xml | Remove-Item"
+
+ #run post in release mode
+ - task: postbuild
+ vars: { BUILD_MODE: release }
+
+
+ postbuild_failed:
+ dir: '{{.USER_WORKING_DIR}}'
+ cmds:
+ - echo "postbuild failed {{.PROJECT_NAME}}"
+
+
+ postbuild:
+ dir: '{{.USER_WORKING_DIR}}'
+ internal: true
+ vars:
+ #the build output directory
+ BUILD_OUT: "{{.USER_WORKING_DIR}}/bin/{{.BUILD_MODE}}/{{.TARGET_FRAMEWORK}}/publish"
+
+ cmds:
+
+ #copy license and readme to target
+ - cd .. && powershell -Command "Copy-Item -Path ./LICENSE.txt -Destination '{{.BUILD_OUT}}/license.txt'"
+ - cd .. && powershell -Command "Copy-Item -Path ./build.readme.md -Destination '{{.BUILD_OUT}}/readme.md'"
+
+ #tar outputs
+ - cd "{{.BUILD_OUT}}" && tar -czf "{{.TARGET}}/{{.BUILD_MODE}}.tgz" .
+
+ packsource:
+ dir: '{{.USER_WORKING_DIR}}'
+ internal: true
+ cmds:
+ #copy source code to target
+ - powershell -Command "Get-ChildItem -Include *.cs,*.csproj -Recurse | Where { \$_.FullName -notlike '*\obj\*' -and \$_.FullName -notlike '*\bin\*' } | Resolve-Path -Relative | tar --files-from - -czf '{{.TARGET}}/src.tgz'"
+
+
+#Remove the output dirs on clean
+ clean:
+ dir: '{{.USER_WORKING_DIR}}'
+ cmds:
+ - cmd: powershell Remove-Item -Recurse './bin'
+ ignore_error: true
+ - cmd: powershell Remove-Item -Recurse './obj'
+ ignore_error: true