-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRakefile
More file actions
50 lines (44 loc) · 1 KB
/
Copy pathRakefile
File metadata and controls
50 lines (44 loc) · 1 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
# Dependencies:
# - rust, cargo, (ruby, rake)
# - pnpm
# - wasm-pack
# - (watchexec)
#
# After clone setup:
# (rm -rf public)
# (git worktree prune)
# git worktree add -B gh-pages public origin/gh-pages
#
# Very initial setup was:
# git checkout --orphan gh-pages
# git commit -m ok --allow-empty
# git push --set-upstream origin gh-pages
# git checkout master
desc 'build before release'
task :default do
got = system 'cargo build --release'
unless got
puts 'Failed'
exit 0
end
system 'wasm-pack build'
Dir.chdir 'www' do
system 'rm dist/*'
system 'pnpm install'
system 'pnpm run build'
end
end
task :release do
Dir.chdir 'public' do
system 'rm *'
system 'cp ../www/dist/* .'
system 'git add --all && git commit -m "pub" && git push'
end
end
desc 'development but not error-informative, use cargo build on errors'
task :dev do
sh 'watchexec -r -e rs,toml -- rake dev_one'
end
task :dev_one do
sh 'cargo build; wasm-pack build; cd www; pnpm install; pnpm run start'
end