-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
33 lines (32 loc) · 868 Bytes
/
Rakefile
File metadata and controls
33 lines (32 loc) · 868 Bytes
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
task :build_all do
require "fileutils"
tags = []
Dir.chdir "../discorb" do
tags = `git tag`.split("\n").sort { |a, b| a[1..].split(".").map(&:to_i) <=> b[1..].split(".").map(&:to_i) }
end
tags.each do |t|
Dir.chdir "../discorb" do
sh "git checkout #{t} -f"
sh "yardoc -n"
end
ruby "scripts/namespaces.rb"
ruby "scripts/methods.rb"
ruby "scripts/files.rb"
prefix = t
if ENV["URL_PREFIX"] && ENV["URL_PREFIX"].length > 0
prefix = ENV["URL_PREFIX"] + "/" + prefix
end
env = {
"NEXT_PUBLIC_URL_PREFIX" => prefix,
"NEXT_PUBLIC_VERSION" => t,
"NEXT_PUBLIC_VERSIONS" => tags.join(":"),
}
sh(env, "npm run build")
sh(env, "npx next export -o out/#{t}")
end
FileUtils.cp_r "out/#{tags.last}/.", "out/"
ensure
Dir.chdir "../discorb" do
sh "git checkout main"
end
end