aboutsummaryrefslogtreecommitdiff
path: root/Taskfile.yaml
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-08-03 21:30:36 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2023-08-03 21:30:36 -0400
commita5a50369250ff5c7d8f1fa53fc31ddb1da2a04a6 (patch)
treed148d7f6d19394f3627b64675ee665fb51a76745 /Taskfile.yaml
parent96fc2b9f719f5c82841a93a17e9e4e2ac1f69487 (diff)
Pre-public update
Diffstat (limited to 'Taskfile.yaml')
-rw-r--r--Taskfile.yaml86
1 files changed, 86 insertions, 0 deletions
diff --git a/Taskfile.yaml b/Taskfile.yaml
new file mode 100644
index 0000000..2bec577
--- /dev/null
+++ b/Taskfile.yaml
@@ -0,0 +1,86 @@
+# https://taskfile.dev
+
+version: '3'
+
+vars:
+ INT_DIR: '{{.SCRATCH_DIR}}/obj/{{.MODULE_NAME}}/'
+ TARGET: '{{.USER_WORKING_DIR}}/bin'
+ RELEASE_DIR: "./bin/release/{{.TARGET_FRAMEWORK}}"
+
+tasks:
+
+ #when build succeeds, archive the output into a tgz
+ postbuild_sucess:
+ dir: '{{.USER_WORKING_DIR}}'
+
+ cmds:
+
+ #run post in debug mode
+ - task: postbuild
+ vars:
+ BUILD_MODE: debug
+ TARGET_OS: linux-x64
+
+ - task: postbuild
+ vars:
+ BUILD_MODE: debug
+ TARGET_OS: win-x64
+
+ - task: postbuild
+ vars:
+ BUILD_MODE: debug
+ TARGET_OS: osx-x64
+
+
+ #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
+ TARGET_OS: linux-x64
+
+ - task: postbuild
+ vars:
+ BUILD_MODE: release
+ TARGET_OS: win-x64
+
+ - task: postbuild
+ vars:
+ BUILD_MODE: release
+ TARGET_OS: osx-x64
+
+ #pack up source code and put in output
+ - powershell -Command "Get-ChildItem -Include *.cs,*.csproj -Recurse | Where { \$_.FullName -notlike '*\obj\*' } | Resolve-Path -Relative | tar --files-from - -czf '{{.TARGET}}/src.tgz'"
+
+
+ postbuild_failed:
+ dir: '{{.USER_WORKING_DIR}}'
+ cmds:
+ - echo "postbuild failed {{.PROJECT_NAME}}"
+
+
+ postbuild:
+ dir: '{{.USER_WORKING_DIR}}'
+ vars:
+ BUILD_DIR: "{{.USER_WORKING_DIR}}/bin/{{.BUILD_MODE}}/{{.TARGET_FRAMEWORK}}/{{.TARGET_OS}}/publish"
+ internal: true
+ cmds:
+
+ #copy license and readme to target
+ - cd .. && powershell -Command "Copy-Item -Path ./LICENSE.txt -Destination '{{.BUILD_DIR}}/license.txt'"
+ - cd .. && powershell -Command "Copy-Item -Path ./build.readme.txt -Destination '{{.BUILD_DIR}}/readme.txt'"
+
+ #tar outputs
+ - cd "{{.BUILD_DIR}}" && tar -czf "{{.TARGET}}/{{.TARGET_OS}}-{{.BUILD_MODE}}.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 \ No newline at end of file