-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskfile.yaml
More file actions
79 lines (70 loc) · 2.26 KB
/
taskfile.yaml
File metadata and controls
79 lines (70 loc) · 2.26 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
version: '3'
dotenv:
- .env
vars:
VERSION: '{{.VERSION | default ""}}'
tasks:
format:
desc: Reformat the solution
silent: true
cmds:
- echo "🎨 Reformatting with CSharpier"
- dotnet csharpier format .
- echo "✅ Reformatted successfully"
clean:
desc: Clean NuGet packages from Release folder
silent: true
cmds:
- echo "🧹 Cleaning"
- '[ -d ./nupkg ] && rm -r ./nupkg || true'
- dotnet clean --configuration Release
- echo "✅ Cleaning complete"
restore:
desc: Restore NuGet dependencies
silent: true
deps: [ clean ]
cmds:
- echo "📥 Restoring dependencies"
- dotnet restore
- echo "✅ Dependencies restored"
build:
desc: Build solution in Release configuration
silent: true
deps: [ restore ]
cmds:
- echo "🔨 Building Release"
- dotnet build --configuration Release --no-restore {{if .VERSION}}/p:Version={{.VERSION}}{{end}}
- echo "✅ Release build complete"
pack:
desc: Build the NuGet package
silent: true
deps: [ build ]
cmds:
- echo "📦 Packing Packages"
- dotnet pack --configuration Release --no-build --output ./nupkg {{if .VERSION}}/p:Version={{.VERSION}}{{end}}
- echo "✅ Packed"
publish:
desc: Publish the package to a package registry
silent: true
requires:
vars: [ VERSION ]
deps: [ pack ]
cmds:
- echo "🚀 Publishing version {{.VERSION}}"
- dotnet nuget push ./nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY_LOCAL --skip-duplicate
- echo "✨ Published"
publish-local:
desc: Package and publish to local NuGet source for use in other solutions
silent: true
requires:
vars: [ VERSION ]
deps: [ pack ]
vars:
LOCAL_NUGET_SOURCE: '{{.LOCAL_NUGET_SOURCE | default "~/LocalNuGetPackages"}}'
cmds:
- echo "📦 Publishing version {{.VERSION}} to local NuGet source"
- mkdir -p {{.LOCAL_NUGET_SOURCE}}
- cp -f ./nupkg/*.nupkg {{.LOCAL_NUGET_SOURCE}}/
- echo "✅ Published to {{.LOCAL_NUGET_SOURCE}}"
- echo "💡 Add this source to your other solution with:"
- echo " dotnet nuget add source {{.LOCAL_NUGET_SOURCE}} --name local"