diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 0000000..a002c4a --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,26 @@ +genrule( + name = "generate_tts_client_rb", + srcs = [ + "tts-client.rb.tpl", + "//experimental/users/acmcarther/llm/tts_grpc:tts_client_go", + ], + outs = ["tts-client.rb"], + cmd = """ + # Identify the binary. It's the file that doesn't end in .tpl + for f in $(locations //experimental/users/acmcarther/llm/tts_grpc:tts_client_go); do + BINARY=$$f + break + done + + # Calculate SHA256 + if command -v sha256sum >/dev/null 2>&1; then + HASH=$$(sha256sum $$BINARY | cut -d' ' -f1) + else + HASH=$$(shasum -a 256 $$BINARY | cut -d' ' -f1) + fi + + # Substitute into template + sed "s/{SHA256}/$$HASH/g" $(location tts-client.rb.tpl) > $@ + """, + visibility = ["//visibility:public"], +) diff --git a/README.md b/README.md index 9843600..538ac1b 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -# Homebrew Formulas\n\nFormulas in this directory are automatically synced to acmcarther/yesod-homebrew-tools. +# Homebrew Formulas + +This directory contains homebrew formulas materialized from the main monorepo. \ No newline at end of file diff --git a/copy.bara.sky b/copy.bara.sky deleted file mode 100644 index a43a704..0000000 --- a/copy.bara.sky +++ /dev/null @@ -1,28 +0,0 @@ -# tools/homebrew/copy.bara.sky - -# Source: Your Monorepo -sourceUrl = "https://forgejo.csbx.dev/acmcarther/yesod.git" -# Destination: The Public Homebrew Tap -destinationUrl = "https://forgejo.csbx.dev/acmcarther/yesod-homebrew-tools.git" - -core.workflow( - name = "default", - origin = git.origin( - url = sourceUrl, - ref = "main", - ), - destination = git.destination( - url = destinationUrl, - fetch = "main", - push = "main", - ), - # Only look at the tools/homebrew directory - origin_files = glob(["tools/homebrew/**"]), - - authoring = authoring.pass_thru("Copybara "), - - # Move tools/homebrew/ -> in the destination - transformations = [ - core.move("tools/homebrew", ""), - ], -) \ No newline at end of file diff --git a/tts-client.rb b/tts-client.rb.tpl similarity index 78% rename from tts-client.rb rename to tts-client.rb.tpl index 9625772..234ba4e 100644 --- a/tts-client.rb +++ b/tts-client.rb.tpl @@ -4,8 +4,8 @@ class TtsClient < Formula version "0.0.1" # URL to your Forgejo Package Registry - url "https://forgejo.csbx.dev/api/packages/acmcarther/generic/tts-client/0.0.1/tts-client-darwin-arm64" - sha256 "13d2109abd08b49f553595e9ea9df541dd37e9a8a316baa32c9d6c563743813f" + url "https://forgejo.csbx.dev/api/packages/acmcarther/generic/tts-client/0.0.2/tts-client-darwin-arm64" + sha256 "{SHA256}" def install # Rename to just 'tts-client' upon installation