Repository navigation
Expand file tree
/
Copy pathTaskfile.home.yml
More file actions
135 lines (121 loc) · 3.72 KB
/
Copy pathTaskfile.home.yml
File metadata and controls
135 lines (121 loc) · 3.72 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
# home ディレクトリに配置してグローバルな作業を行う
# リポジトリに既に taskfile が存在する場合は `t -g` または `tg`
includes:
repos:
taskfile: Taskfile.private.yml
flatten: true
internal: false
optional: true
# vars:
tasks:
default:
cmds:
- echo "This is {{.TASKFILE}} at v{{.TASK_VERSION}}"
- task --list --sort alphanumeric -t {{.TASKFILE}}
silent: true
up:auto:
desc: "Update repository tools automatically"
aliases:
- auto
- "= u and p"
cmds:
- task: up:work
- task: up:push
dir: "{{.USER_WORKING_DIR}}"
up:work:
desc: "Update repository tools"
aliases:
- u
env:
# GitHub CLI からトークンを取得
GITHUB_TOKEN:
sh: gh auth token
cmds:
- task: up:gr
- task: up:config
- task: up:aqua
- task: up:pinact
- task: up:zizmor
- task: up:prek
- task: up:gau
- prek run -a
dir: "{{.USER_WORKING_DIR}}"
up:push:
desc: "Bump tools version commit"
aliases:
- p
vars:
COMMIT_TITLE: "chore: bump tools version"
BRANCH_NAME: "chore/bump-{{ date \"2006-01-02\" now}}"
PR_BODY_FILE: "{{.TASKFILE_DIR}}/__bump_tool_pr_body.txt"
cmds:
- git add -u
- git commit -m "{{.COMMIT_TITLE}}"
- git push origin HEAD:refs/heads/{{.BRANCH_NAME}}
- sleep 1
- gh pr create -t "{{.COMMIT_TITLE}}" -F "{{.PR_BODY_FILE}}" -H "{{.BRANCH_NAME}}" -B "main" | tee -a /tmp/{{date "2006-01-02" now}}.log
- sleep 1
- gh pr merge "{{.BRANCH_NAME}}" --auto -s
- git --no-pager show
dir: "{{.USER_WORKING_DIR}}"
up:gr:
cmds:
- git fetch --all --prune
- git checkout origin/HEAD
dir: "{{.USER_WORKING_DIR}}"
up:gau:
cmds:
- git status
- git add -u
dir: "{{.USER_WORKING_DIR}}"
up:aqua:
desc: "update aqua"
cmds:
- cmd: aqua up
ignore_error: true
- cmd: aqua upc -prune
ignore_error: true
dir: "{{.USER_WORKING_DIR}}"
up:pinact:
summary: |
- `.github/workflows/` 下のワークフロー中の使用バージョンを更新
cmds:
- cmd: pinact run -u
ignore_error: true
dir: "{{.USER_WORKING_DIR}}"
up:zizmor:
summary: |
- `.github/workflows/` 下のワークフローをチェック
cmds:
- cmd: zizmor .
ignore_error: true
dir: "{{.USER_WORKING_DIR}}"
up:prek:
desc: "run prek update --freeze"
summary: |
- .pre-commit-config.yaml を更新
- include-tag, exclude-tag でセマンティックバージョニングに基づいたバージョン選択
- `-rc` や `-alpha`, `-beta` を除外
cmds:
- cmd: prek update --freeze --include-tag 'v*.*.*' --exclude-tag '*-{alpha,beta,rc}*'
ignore_error: true
dir: "{{.USER_WORKING_DIR}}"
up:config:
summary: |
設定ファイル類を最初に更新しておく
配布が終わった処理は削除してもよい
cmds:
- cmd: sed -i 's/rhysd/kjanat/g' .pre-commit-config.yaml
ignore_error: true
- cmd: |
sed -i 's/^\([[:space:]]*\)- id: ryl[[:space:]]*$/\1- id: ryl-check\n\1 args: ["--fix"]/' .pre-commit-config.yaml
ignore_error: true
- cmd: sed -i -E 's/^([[:space:]]*)\[rules(\.|\])/\1[lint.rules\2/' .config/ryl.toml
ignore_error: true
- cmd: sed -i 's/^\[\[per-line-ignores\]\]$/[[lint.per-line-ignores]]/' .config/ryl.toml
ignore_error: true
- cmd: sed -i -E 's/^([[:space:]]*)ignore([[:space:]]*=)/\1exclude\2/' .config/ryl.toml
ignore_error: true
dir: "{{.USER_WORKING_DIR}}"