-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
93 lines (78 loc) · 2.66 KB
/
Copy pathTaskfile.yaml
File metadata and controls
93 lines (78 loc) · 2.66 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
93
# https://taskfile.dev
version: '3'
tasks:
all:
- task: clean
- task: restore
- task: format
- task: test
- task: build
- task: pack
- task: install
build:
cmds:
- dotnet build ApolloSync.csproj --configuration Release
format:
cmds:
- dotnet format ApolloSync.csproj
pack:
deps:
- build
cmds:
- powershell cp -Recurse -Force bin/Release/net462/ .\dist\raw\
- ~/AppData/Local/Playnite/Toolbox.exe pack bin/Release/net462/ dist
clean:
cmds:
- powershell -command "Remove-Item -Force -Recurse .\dist -ErrorAction Ignore" || true
- powershell -command "Remove-Item -Force -Recurse .\src\bin\ -ErrorAction Ignore" || true
install:
cmds:
- powershell ./dist/*.pext
logs:
cmds:
- powershell "Get-Content ~/Appdata/Roaming/Playnite/extensions.log" -Wait
restore:
cmds:
- dotnet restore ApolloSync.csproj
test:
deps:
- restore
cmds:
- dotnet test Tests/ApolloSync.Tests.csproj -v minimal
bump:
desc: Create release branch and bump version
requires:
vars: [VERSION]
cmds:
- git checkout -b "release/v{{.VERSION}}"
- yq -i '.Version = "{{.VERSION}}"' extension.yaml
- |
addon_id=$(yq '.AddonId' manifest.yaml)
addon_name="${addon_id%%_*}"
repo_url=$(git remote get-url origin | sed 's|git@github.com:|https://github.com/|' | sed 's|\.git$||')
required_api=$(yq '.Packages[0].RequiredApiVersion' manifest.yaml)
package_url="${repo_url}/releases/download/v{{.VERSION}}/${addon_name}_v{{.VERSION}}.pext"
release_date=$(date +%Y-%m-%d)
last_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -n "$last_tag" ]; then
range="${last_tag}..HEAD"
else
range="HEAD"
fi
VERSION="{{.VERSION}}" \
REQUIRED_API="$required_api" \
RELEASE_DATE="$release_date" \
PACKAGE_URL="$package_url" \
yq -i '.Packages = [{"Version": env(VERSION), "RequiredApiVersion": env(REQUIRED_API), "ReleaseDate": env(RELEASE_DATE), "PackageUrl": env(PACKAGE_URL), "Changelog": []}] + .Packages' manifest.yaml
git log $range --pretty=format:"%s" --no-merges --reverse | while IFS= read -r msg; do
ENTRY="$msg" yq -i '.Packages[0].Changelog += [strenv(ENTRY)]' manifest.yaml
done
echo ""
echo "Version bumped to {{.VERSION}}"
echo "Branch: release/v{{.VERSION}}"
echo ""
echo "Review the generated changelog in manifest.yaml"
echo "Then commit and push:"
echo " git add extension.yaml manifest.yaml"
echo " git commit -m 'Bump version to {{.VERSION}}'"
echo " git push -u origin release/v{{.VERSION}}"