diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index d2831dd..2da7937 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -154,10 +154,12 @@ load("@rules_rust//tools/rust_analyzer:deps.bzl", "rust_analyzer_dependencies") rust_analyzer_dependencies() - register_toolchains("//nix/rust:rust_analyzer_toolchain") + register_toolchains("//nix/rust:rustfmt_toolchain") + register_toolchains("//nix/rust:wasm_bindgen_toolchain") + register_toolchains("@rules_rust//rust/private/dummy_cc_toolchain:dummy_cc_wasm32_toolchain") http_archive( @@ -231,4 +233,4 @@ oci_pull( "linux/amd64", "linux/arm64", ], -) \ No newline at end of file +) diff --git a/blade/BUILD.bazel b/blade/BUILD.bazel index 6fb43dd..e8fe89e 100644 --- a/blade/BUILD.bazel +++ b/blade/BUILD.bazel @@ -1,6 +1,6 @@ load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_shared_library") load("@rules_rust//wasm_bindgen/rules_js:defs.bzl", "js_rust_wasm_bindgen") -load("@rules_oci//oci:defs.bzl", "oci_image", "oci_tarball") +load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push", "oci_tarball") load("@rules_pkg//:pkg.bzl", "pkg_tar") load("//nix/bazel:runfiles.bzl", "runfiles") @@ -123,12 +123,12 @@ oci_image( name = "blade_image", base = "@distroless_base", entrypoint = ["/app/blade/blade"], - workdir = "/app/blade/blade.runfiles/blade", + tags = ["noosx"], tars = [ ":blade_tar", "@oci_base//:closure.tar", ], - tags = ["noosx"], + workdir = "/app/blade/blade.runfiles/blade", ) oci_tarball( @@ -137,3 +137,24 @@ oci_tarball( repo_tags = ["ghcr.io/dolcetriade/blade:latest"], tags = ["noosx"], ) + +genrule( + name = "tags", + outs = ["tags.txt"], + cmd = """ + s=$$(cat bazel-out/stable-status.txt | grep BUILD_EMBED_LABEL | awk '{print $$2}') + if [[ -n $$s ]]; then + echo $$s > $@ + else + echo 0.0.0 > $@ + fi + """, + stamp = 1, +) + +oci_push( + name = "blade_push", + image = ":blade_image", + remote_tags = ":tags", + repository = "ghcr.io/dolcetriade/blade", +) diff --git a/blade/bytestream/proto/BUILD.bazel b/blade/bytestream/proto/BUILD.bazel index 4455091..1c116ef 100644 --- a/blade/bytestream/proto/BUILD.bazel +++ b/blade/bytestream/proto/BUILD.bazel @@ -4,4 +4,4 @@ rust_prost_library( name = "bytestream_proto", proto = "@googleapis//google/bytestream:bytestream_proto", visibility = ["//visibility:public"], -) \ No newline at end of file +) diff --git a/blade/state/BUILD.bazel b/blade/state/BUILD.bazel index 9cb8af4..62976f0 100644 --- a/blade/state/BUILD.bazel +++ b/blade/state/BUILD.bazel @@ -17,12 +17,12 @@ rust_library( "@wasm_crate//:serde", ], "//conditions:default": [ + "//blade/bytestream", "@crate//:anyhow", "@crate//:cfg-if", "@crate//:futures", "@crate//:serde", "@crate//:tokio", - "//blade/bytestream", ], }), ) diff --git a/nix/bazel/runfiles.bzl b/nix/bazel/runfiles.bzl index 458c5e8..fab24f4 100644 --- a/nix/bazel/runfiles.bzl +++ b/nix/bazel/runfiles.bzl @@ -117,4 +117,4 @@ runfiles = rule( doc = "If set, exclude files that contain this substr.", ), }, -) \ No newline at end of file +)