diff --git a/.bazelignore b/.bazelignore index d2c27ed..4e410b6 100644 --- a/.bazelignore +++ b/.bazelignore @@ -1,2 +1,3 @@ external dist +.cache diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..57779a4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*] +end_of_line = lf diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index f008fd6..5854315 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -29,14 +29,14 @@ setup_7zip() http_archive( name = "rules_blender", - sha256 = "05acad9716ec6c80cadb603e7f585acbaadf670bce6920959824122e25e97e9c", - strip_prefix = "rules_blender-dc8c77bdb27e4af7cb1c95610a119a8ad64e57c7", - urls = ["https://github.com/zaucy/rules_blender/archive/dc8c77bdb27e4af7cb1c95610a119a8ad64e57c7.zip"], + integrity = "sha256-HKH9Y2wiL/EkVEFcaCZHT8ACW8SHX24UZ8EHEhwcI8w=", + strip_prefix = "rules_blender-e5f5b1ef894fe4da7b3cbf85ca857b6fd3bdffba", + urls = ["https://github.com/zaucy/rules_blender/archive/e5f5b1ef894fe4da7b3cbf85ca857b6fd3bdffba.zip"], ) load("@rules_blender//:repo.bzl", "blender_repository") -blender_repository(name = "blender") +blender_repository(name = "blender", blender_version = "system", only_system_installed_blender = True) http_archive( name = "ecsact_logo", diff --git a/release.nu b/release.nu index 41fe598..63669c5 100644 --- a/release.nu +++ b/release.nu @@ -1,45 +1,48 @@ -def get-ecsact-deps [] { - (buildozer -output_json 'print name version' //MODULE.bazel:%bazel_dep - | from json - | get records - | each {|record| {name: $record.fields.0.text, version: $record.fields.1.text?} } - | filter {|dep| $dep.name | str starts-with "ecsact_"} - ) -} - -def main [version: string] { - let start_dir = $env.PWD; - let before_update_deps = get-ecsact-deps; - let changelog_template = [$start_dir, "release-notes-template"] | path join; - - $before_update_deps | each {|dep| bzlmod add $dep.name; }; - - let release_notes = (get-ecsact-deps | each {|dep| - let before_version = $before_update_deps | where name == $dep.name | get version | get 0; - let after_version = $dep | get version; - let dep_repo_remote = $"https://github.com/ecsact-dev/($dep.name)"; - let cached_repo_dir = $".cache/repos/($dep.name)"; - mut dep_release_notes = ""; - - if $after_version != $before_version { - rm -rf $cached_repo_dir; - git clone --quiet $dep_repo_remote $cached_repo_dir; - cd $cached_repo_dir; - let changelog = cog changelog $"($before_version)..($after_version)" -o ecsact-dev --repository $dep.name --remote "github.com" -t $changelog_template; - rm -rf $cached_repo_dir; - cd $start_dir; - $dep_release_notes += $"# ($dep.name) ($before_version) -> ($after_version)\n\n"; - $dep_release_notes += $changelog; - } - - $dep_release_notes - }); - - let release_notes = $release_notes | reduce {|$section, $full| $full + $section} -f ""; - git add MODULE.bazel; - git commit -m $"chore\(deps\): ecsact repos for ($version) release"; - git push origin main; - git tag $version; - git push origin $version; - gh release create $version -n $release_notes --latest -t $version --verify-tag --latest; -} +def get-ecsact-deps [] { + (buildozer -output_json 'print name version' //MODULE.bazel:%bazel_dep + | from json + | get records + | each {|record| {name: $record.fields.0.text, version: $record.fields.1.text?} } + | filter {|dep| $dep.name | str starts-with "ecsact_"} + ) +} + +def main [version: string] { + let start_dir = $env.PWD; + let before_update_deps = get-ecsact-deps; + let changelog_template = [$start_dir, "release-notes-template"] | path join; + + $before_update_deps | each {|dep| bzlmod add $dep.name; }; + + # sanity check + bazel build //...; + + let release_notes = (get-ecsact-deps | each {|dep| + let before_version = $before_update_deps | where name == $dep.name | get version | get 0; + let after_version = $dep | get version; + let dep_repo_remote = $"https://github.com/ecsact-dev/($dep.name)"; + let cached_repo_dir = $".cache/repos/($dep.name)"; + mut dep_release_notes = ""; + + if $after_version != $before_version { + rm -rf $cached_repo_dir; + git clone --quiet $dep_repo_remote $cached_repo_dir; + cd $cached_repo_dir; + let changelog = cog changelog $"($before_version)..($after_version)" -o ecsact-dev --repository $dep.name --remote "github.com" -t $changelog_template; + rm -rf $cached_repo_dir; + cd $start_dir; + $dep_release_notes += $"# ($dep.name) ($before_version) -> ($after_version)\n\n"; + $dep_release_notes += $changelog; + } + + $dep_release_notes + }); + + let release_notes = $release_notes | reduce {|$section, $full| $full + $section} -f ""; + git add MODULE.bazel; + git commit -m $"chore\(deps\): ecsact repos for ($version) release"; + git push origin main; + git tag $version; + git push origin $version; + gh release create $version -n $release_notes --latest -t $version --verify-tag --latest; +}