|
|
@@ -204,9 +204,9 @@ end
|
|
|
|
|
|
task :ci_publish_web do
|
|
|
require 'json'
|
|
|
- system 'git clone --depth 1 -q https://github.com/urho3d/urho3d.github.io.git build/urho3d.github.io' or abort 'Failed to clone urho3d/urho3d.github.io'
|
|
|
- system "rsync -a --delete --exclude tool --exclude *.pak --exclude index.md build/ci/bin/ build/urho3d.github.io/samples" or abort 'Failed to rsync Web samples'
|
|
|
- Dir.chdir('build/urho3d.github.io/samples') {
|
|
|
+ system 'git clone --depth 1 -q https://github.com/urho3d/urho3d.io.git build/urho3d.io' or abort 'Failed to clone urho3d/urho3d.io'
|
|
|
+ system "rsync -a --delete --exclude tool --exclude *.pak --exclude index.md build/ci/bin/ build/urho3d.io/samples" or abort 'Failed to rsync Web samples'
|
|
|
+ Dir.chdir('build/urho3d.io/samples') {
|
|
|
next unless system 'git diff --quiet Urho3D.js.data'
|
|
|
uuid = `git diff --color=never --word-diff-regex='\\w+' --word-diff=porcelain Urho3D.js`.split.grep(/^[+-]\w+-/).map { |it| it[0] = ''; it }
|
|
|
system %Q(ruby -i.bak -pe "gsub '#{uuid.last}', '#{uuid.first}'" Urho3D.js) or abort 'Failed to substitute UUID'
|
|
|
@@ -218,7 +218,7 @@ task :ci_publish_web do
|
|
|
end
|
|
|
}
|
|
|
web = {'samples' => {}}
|
|
|
- Dir.chdir('build/urho3d.github.io/samples') { web['samples']['Native'] = Dir['*.html'].sort }
|
|
|
+ Dir.chdir('build/urho3d.io/samples') { web['samples']['Native'] = Dir['*.html'].sort }
|
|
|
web['player'] = web['samples']['Native'].pop # Assume the last sample after sorting is the Urho3DPlayer.html
|
|
|
{'AngelScript' => 'Scripts', 'Lua' => 'LuaScripts'}.each { |lang, subdir|
|
|
|
Dir.chdir("bin/Data/#{subdir}") {
|
|
|
@@ -228,12 +228,12 @@ task :ci_publish_web do
|
|
|
web['samples'][lang] = (script_samples - deleted_samples).map { |sample| "#{subdir}/#{sample}" }
|
|
|
}
|
|
|
}
|
|
|
- File.open('build/urho3d.github.io/_data/web.json', 'w') { |file| file.puts web.to_json }
|
|
|
+ File.open('build/urho3d.io/_data/web.json', 'w') { |file| file.puts web.to_json }
|
|
|
system %Q{
|
|
|
- cd build/urho3d.github.io && \\
|
|
|
+ cd build/urho3d.io && \\
|
|
|
git config user.name #{ENV['PUBLISHER_NAME']} && \\
|
|
|
git config user.email #{ENV['PUBLISHER_EMAIL']} && \\
|
|
|
- git remote set-url --push origin https://#{ENV['PUBLISHER_TOKEN']}@github.com/urho3d/urho3d.github.io.git && \\
|
|
|
+ git remote set-url --push origin https://#{ENV['PUBLISHER_TOKEN']}@github.com/urho3d/urho3d.io.git && \\
|
|
|
git add -A . && \\
|
|
|
( git commit -qm "GH Actions: Web samples update at #{Time.now.utc}.\n\nCommit: https://github.com/#{ENV['GITHUB_REPOSITORY']}/commit/#{ENV['GITHUB_SHA']}\n\nMessage: #{`git log --format=%B -n 1`}" || true) && \\
|
|
|
git push -q >/dev/null 2>&1
|