-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
88 lines (77 loc) · 2.38 KB
/
Taskfile.yml
File metadata and controls
88 lines (77 loc) · 2.38 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
# https://taskfile.dev
version: '3'
vars:
VERSION:
sh: |
docker run --rm -v "$(pwd):/repo" gittools/gitversion:latest /repo /showvariable FullSemVer
env:
# Make version available to Vite build
# import.meta.env.VITE_APP_VERSION
VITE_APP_VERSION: "{{ .VERSION }}"
tasks:
dev:
desc: Start development server
cmd: pnpm run docs:dev
preview:
desc: Build site for preview
cmd: pnpm run docs:preview
build:
desc: Build the site with release notes and changelog
cmds:
- git tag v{{ .VERSION }} # set tag for changelog/releasenotes to pick up
- task: _changelog
- task: _releasenotes
- git tag -d v{{ .VERSION }} # remove temporary tag
- task: _build
release:
desc: "Full release: build, version, tag (use PUSH=true to push)"
vars:
PUSH: '{{ .PUSH | default "false" }}'
cmds:
- task: build
- task: _version
- task: _push
_build:
internal: true
desc: Build the site
env:
VITE_APP_VERSION: "{{ .VERSION }}"
cmd: pnpm run docs:build
_changelog:
internal: true
desc: Generate changelog
preconditions:
- sh: command -v git-cliff
msg: "git-cliff not installed"
cmd: git-cliff --tag {{ .VERSION }} --output CHANGELOG.md
_releasenotes:
internal: true
desc: Generate release notes
preconditions:
- sh: command -v pandoc
msg: "pandoc not installed"
- sh: test -f .pandoc/strip-ids.lua
msg: "pandoc filter missing"
cmds:
- reno -q report --no-show-source | pandoc --lua-filter .pandoc/strip-ids.lua --from=rst -o RELEASE_NOTES.md
_version:
internal: true
desc: Bump version and create git tag
cmds:
- pnpm version {{ .VERSION }} --allow-same-version --no-git-tag-version
- git add package.json CHANGELOG.md RELEASE_NOTES.md
- |
git commit -m "chore(release): v{{ .VERSION }}" -m "[skip ci]"
- git tag -f --annotate v{{ .VERSION }} -m "Release v{{ .VERSION }}"
_push:
internal: true
desc: Push commits and tags to remote
# env:
# GH_TOKEN: "{{ .GITHUB_TOKEN }}"
preconditions:
- sh: '[ "{{ .PUSH }}" = "true" ]'
msg: "Skipping push (use PUSH=true to enable)"
cmds:
# - echo "push"
- git push origin HEAD --follow-tags
- gh release create v{{ .VERSION }} --title "Release v{{ .VERSION }}" --notes-file RELEASE_NOTES.md