forked from jozu-ai/kitops
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Homebrew Tap Capability (jozu-ai#520)
* Added Homebrew Tap Capability - updated platform-release.yaml to include steps required for homebrew tap functionality -updated .goreleaser.darwin.yaml to export MacOS binaries in both .zip and .tar.gz formats - added create-homebrew-recipe.awk - added kitops.rb.template * Update .github/workflows/platform-release.yaml suggestion from Angel Co-authored-by: Angel Misevski <[email protected]> * Update platform-release.yaml Incorporated Angel's feedback * Update platform-release.yaml Fixed indention issues * Update .goreleaser.darwin.yaml removed i386 from supported MacOS builds --------- Co-authored-by: Angel Misevski <[email protected]>
- Loading branch information
1 parent
28d7d80
commit 4a7308a
Showing
4 changed files
with
226 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Usage: awk -f create-homebrew-recipe.awk homebrew-metadata.txt | ||
|
||
BEGIN { | ||
template = "kitops.rb.template"; | ||
recipe = "kitops.rb"; | ||
} | ||
|
||
{ | ||
# Read relevant fields from input file | ||
# (intended to be homebrew-metadata.txt) | ||
shas[$3]=$1; | ||
urls[$3]=$2; | ||
version[$3]=$4; | ||
} | ||
|
||
END { | ||
# Read a line from template, replace special fields, | ||
# and print result to recipe file | ||
while ((getline ln < template) > 0) | ||
{ | ||
sub(/url @@darwin-arm64/, "url " urls["darwin-arm64"], ln); | ||
sub(/sha256 @@darwin-arm64/, "sha256 " shas["darwin-arm64"], ln); | ||
|
||
sub(/url @@darwin-x86_64/, "url " urls["darwin-x86_64"], ln); | ||
sub(/sha256 @@darwin-x86_64/, "sha256 " shas["darwin-x86_64"], ln); | ||
|
||
sub(/url @@linux-arm64/, "url " urls["linux-arm64"], ln); | ||
sub(/sha256 @@linux-arm64/, "sha256 " shas["linux-arm64"], ln); | ||
|
||
sub(/url @@linux-x86_64/, "url " urls["linux-x86_64"], ln); | ||
sub(/sha256 @@linux-x86_64/, "sha256 " shas["linux-x86_64"], ln); | ||
|
||
sub(/url @@linux-i386/, "url " urls["linux-i386"], ln); | ||
sub(/sha256 @@linux-i386/, "sha256 " shas["linux-i386"], ln); | ||
|
||
sub(/@@version/, version["darwin-arm64"], ln); | ||
|
||
print(ln) > recipe; | ||
} | ||
|
||
# Close template and recipe fields | ||
close(recipe); | ||
close(template); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
class Kitops < Formula | ||
desc "Packaging and versioning system for AI/ML projects" | ||
homepage "https://KitOps.ml" | ||
license "Apache-2.0" | ||
|
||
on_macos do | ||
on_arm do | ||
url @@darwin-arm64 | ||
sha256 @@darwin-arm64 | ||
end | ||
on_intel do | ||
url @@darwin-x86_64 | ||
sha256 @@darwin-x86_64 | ||
end | ||
|
||
end | ||
|
||
on_linux do | ||
on_arm do | ||
url @@linux-arm64 | ||
sha256 @@linux-arm64 | ||
end | ||
on_intel do | ||
if Hardware::CPU.is_64_bit? | ||
url @@linux-x86_64 | ||
sha256 @@linux-x86_64 | ||
else | ||
url @@linux-i386 | ||
sha256 @@linux-i386 | ||
end | ||
end | ||
end | ||
|
||
def install | ||
bin.install "kit" | ||
end | ||
|
||
test do | ||
expected_version = "Version: @@version" | ||
actual_version = shell_output("#{bin}/kit version").strip | ||
assert_match expected_version, actual_version | ||
end | ||
end |