-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
92 lines (73 loc) · 2.56 KB
/
Taskfile.yaml
File metadata and controls
92 lines (73 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# 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_FRAMEWORK: '{{ .TARGET_FRAMEWORK | default "net8.0" }}'
BINARY_DIR: '{{ .BINARY_DIR | default "bin" }}'
RELEASE_DIR: "./bin/release/{{ .TARGET_FRAMEWORK }}/publish"
TARGET_DIR: '{{ .USER_WORKING_DIR }}/{{ .BINARY_DIR }}'
tasks:
default:
desc: 'When run from a library directory, builds the managed project'
dir: "{{ .USER_WORKING_DIR }}"
vars:
CONFIGURATION: '{{ .CONFIGURATION | default "release" }}'
cmds:
- cmd: cd src/ &&
dotnet build
--configuration {{ .CONFIGURATION }}
--verbosity detailed
{{ .CLI_ARGS }}
#when build succeeds, archive the output into a tgz
postbuild_success:
dir: '{{ .USER_WORKING_DIR }}'
cmds:
#remove unnecessary files from the release dir
- cmd: powershell -Command "Get-ChildItem -Recurse '{{ .RELEASE_DIR }}/' -Include *.pdb,*.xml | Remove-Item"
platforms: [ "windows" ]
- cmd: cd '{{ .RELEASE_DIR }}' && rm -f *.pdb *.xml
platforms: [ "linux", "darwin" ]
- task: pack-parallel
pack-parallel:
internal: true
deps:
- task: packsource
- task: postbuild
vars: { BUILD_MODE: debug }
- task: postbuild
vars: { BUILD_MODE: release }
postbuild_failed:
dir: '{{.USER_WORKING_DIR}}'
cmds: []
postbuild:
dir: '{{ .USER_WORKING_DIR }}'
internal: true
vars:
#the build output directory
BUILD_OUT: "{{ .BINARY_DIR }}/{{ .BUILD_MODE }}/{{ .TARGET_FRAMEWORK }}/publish"
cmds:
- cmd: cp '../build.readme.md' '{{ .BUILD_OUT }}/readme.md'
#tar outputs
- cmd: cd "{{ .BUILD_OUT }}" && tar{{ if eq OS "windows" }}.exe{{ end }} -czf "{{ .TARGET_DIR }}/{{ .BUILD_MODE }}.tgz" .
packsource:
dir: '{{ .USER_WORKING_DIR }}'
internal: true
vars:
EXCLUDES:
--exclude="bin"
--exclude="obj"
cmds:
#pack up source code and put in output
- cmd: tar{{ if eq OS "windows" }}.exe{{ end }}
{{ .EXCLUDES }} -czf '{{ .USER_WORKING_DIR }}/{{ .BINARY_DIR }}/src.tgz' .
#Remove the output dirs on clean
clean:
dir: '{{ .USER_WORKING_DIR }}'
ignore_error: true
cmds:
- for: [ bin/, obj/ ]
cmd: rm -rf '{{ .ITEM }}'