ci: Created the homebrew installation steps
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
# Documentation: https://docs.brew.sh/Formula-Cookbook
|
||||||
|
# https://rubydoc.brew.sh/Formula
|
||||||
|
class Loki < Formula
|
||||||
|
desc "All-in-one, batteries included LLM CLI tool"
|
||||||
|
homepage "https://github.com/Dark-Alex-17/loki"
|
||||||
|
if OS.mac? and Hardware::CPU.arm?
|
||||||
|
url "https://github.com/Dark-Alex-17/loki/releases/download/v$version/loki-aarch64-apple-darwin.tar.gz"
|
||||||
|
sha256 "$hash_mac_arm"
|
||||||
|
elsif OS.mac? and Hardware::CPU.intel?
|
||||||
|
url "https://github.com/Dark-Alex-17/loki/releases/download/v$version/loki-x86_64-apple-darwin.tar.gz"
|
||||||
|
sha256 "$hash_mac"
|
||||||
|
else
|
||||||
|
url "https://github.com/Dark-Alex-17/loki/releases/download/v$version/loki-x86_64-unknown-linux-musl.tar.gz"
|
||||||
|
sha256 "$hash_linux"
|
||||||
|
end
|
||||||
|
version "$version"
|
||||||
|
license "MIT"
|
||||||
|
|
||||||
|
def install
|
||||||
|
bin.install "loki"
|
||||||
|
ohai "You're done! Get started with \"loki --help\""
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import hashlib
|
||||||
|
import sys
|
||||||
|
from string import Template
|
||||||
|
|
||||||
|
args = sys.argv
|
||||||
|
version = args[1]
|
||||||
|
template_file_path = args[2]
|
||||||
|
generated_file_path = args[3]
|
||||||
|
|
||||||
|
# Deployment files
|
||||||
|
hash_mac = args[4].strip()
|
||||||
|
hash_mac_arm = args[5].strip()
|
||||||
|
hash_linux = args[6].strip()
|
||||||
|
|
||||||
|
print("Generating formula")
|
||||||
|
print(" VERSION: %s" % version)
|
||||||
|
print(" TEMPLATE PATH: %s" % template_file_path)
|
||||||
|
print(" SAVING AT: %s" % generated_file_path)
|
||||||
|
print(" MAC HASH: %s" % hash_mac)
|
||||||
|
print(" MAC ARM HASH: %s" % hash_mac_arm)
|
||||||
|
print(" LINUX HASH: %s" % hash_linux)
|
||||||
|
|
||||||
|
with open(template_file_path, "r") as template_file:
|
||||||
|
template = Template(template_file.read())
|
||||||
|
substitute = template.safe_substitute(version=version, hash_mac=hash_mac, hash_mac_arm=hash_mac_arm, hash_linux=hash_linux)
|
||||||
|
print("\n================== Generated package file ==================\n")
|
||||||
|
print(substitute)
|
||||||
|
print("\n============================================================\n")
|
||||||
|
|
||||||
|
with open(generated_file_path, "w") as generated_file:
|
||||||
|
generated_file.write(substitute)
|
||||||
Reference in New Issue
Block a user