Skip to content

Commit 8c85cae

Browse files
committed
Add gel-cli formulae
1 parent d0c9b96 commit 8c85cae

8 files changed

+184
-21
lines changed

.github/workflows/autoupdate.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
uses: actions/checkout@v4
1717
- uses: actions/setup-python@v5
1818
with:
19-
python-version: '3.10'
19+
python-version: "3.12"
2020
- name: Install dependencies
2121
run: pip install semver jinja2
2222
- name: Run autoupdate.py
2323
run: ./autoupdate.py
24-
- uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d
24+
- uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 # v5.1.0
2525
with:
2626
commit_message: "Auto-update package versions"

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ jobs:
88
runs-on: macos-latest
99
steps:
1010
- name: Set up Git repository
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1212
- name: Run brew test-bot
1313
run: |
1414
set -e
1515
brew update
16-
HOMEBREW_TAP_DIR="/usr/local/Homebrew/Library/Taps/edgedb/homebrew-tap"
16+
HOMEBREW_TAP_DIR="/usr/local/Homebrew/Library/Taps/geldata/homebrew-tap"
1717
mkdir -p "$HOMEBREW_TAP_DIR"
1818
rm -rf "$HOMEBREW_TAP_DIR"
1919
ln -s "$PWD" "$HOMEBREW_TAP_DIR"

Formula.rb.tpl

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
{% set binary = "edgedb" + ("-{}".format(channel) if channel != "release" else "") -%}
1+
{% set binary = name + ("-{}".format(channel) if channel != "release" else "") -%}
22

3-
class EdgedbCli{{ channel.capitalize() if channel != "release" }} < Formula
4-
desc "Latest release of the EdgeDB command-line client (edgedb)"
5-
homepage "https://github.com/edgedb/edgedb-cli"
3+
class {{ name.capitalize() }}Cli{{ channel.capitalize() if channel != "release" }} < Formula
4+
desc "Latest release of the {{ marketing_name }} command-line client ({{ name }})"
5+
homepage "https://github.com/geldata/gel-cli"
66
version "{{ version }}"
77

88
on_macos do

Formula/gel-cli-nightly.rb

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
class GelCliNightly < Formula
2+
desc "Latest release of the Gel command-line client (gel)"
3+
homepage "https://github.com/geldata/gel-cli"
4+
version "7.1.0-dev.1297"
5+
6+
on_macos do
7+
if Hardware::CPU.physical_cpu_arm64?
8+
url "https://packages.geldata.com/archive/aarch64-apple-darwin.nightly/gel-cli-7.1.0-dev.1297+c5c8527",
9+
using: :nounzip
10+
sha256 "258256541b9731a23624073261bf1e27f0fe4b97eaa9908ed22dcf1e2a31d0b4"
11+
12+
def install
13+
bin.install "gel-cli-7.1.0-dev.1297+c5c8527" => "gel-nightly"
14+
end
15+
elsif Hardware::CPU.intel?
16+
url "https://packages.geldata.com/archive/x86_64-apple-darwin.nightly/gel-cli-7.1.0-dev.1297+371ff12",
17+
using: :nounzip
18+
sha256 "c33997291f1c2983f9c8359fde185fcb8707c7ee90d7ad344cbec9bf3bdff4ed"
19+
20+
def install
21+
bin.install "gel-cli-7.1.0-dev.1297+371ff12" => "gel-nightly"
22+
end
23+
else
24+
odie "Unsupported CPU architecture!"
25+
end
26+
end
27+
28+
on_linux do
29+
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
30+
url "https://packages.geldata.com/archive/aarch64-unknown-linux-musl.nightly/gel-cli-7.1.0-dev.1297+aae2cc7",
31+
using: :nounzip
32+
sha256 "03882b1ad1e95f3333d2f15ab619815f7438aac461885ebec1e4a031acac5efd"
33+
34+
def install
35+
bin.install "gel-cli-7.1.0-dev.1297+aae2cc7" => "gel-nightly"
36+
end
37+
elsif Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
38+
url "https://packages.geldata.com/archive/x86_64-unknown-linux-musl.nightly/gel-cli-7.1.0-dev.1297+dfa6787",
39+
using: :nounzip
40+
sha256 "ff512cf65a28a1358206d380e1137e17799934e99a50385f4e82a238838633de"
41+
42+
def install
43+
bin.install "gel-cli-7.1.0-dev.1297+dfa6787" => "gel-nightly"
44+
end
45+
else
46+
odie "Unsupported CPU architecture!"
47+
end
48+
end
49+
50+
test do
51+
system "#{bin}/gel-nightly", "--version"
52+
end
53+
end

Formula/gel-cli-testing.rb

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
class GelCliTesting < Formula
2+
desc "Latest release of the Gel command-line client (gel)"
3+
homepage "https://github.com/geldata/gel-cli"
4+
version "7.1.0-alpha.1"
5+
6+
on_macos do
7+
if Hardware::CPU.physical_cpu_arm64?
8+
url "https://packages.geldata.com/archive/aarch64-apple-darwin.testing/gel-cli-7.1.0-alpha.1+a8d565b",
9+
using: :nounzip
10+
sha256 "455dada1aae521453ab21063cfe5b0908001c74611234515574e21b1aa565339"
11+
12+
def install
13+
bin.install "gel-cli-7.1.0-alpha.1+a8d565b" => "gel-testing"
14+
end
15+
elsif Hardware::CPU.intel?
16+
url "https://packages.geldata.com/archive/x86_64-apple-darwin.testing/gel-cli-7.1.0-alpha.1+a8d565b",
17+
using: :nounzip
18+
sha256 "78aa0255f3aad78c3250c24dcbe026423d7e6dc17c187a91214657da2400ac20"
19+
20+
def install
21+
bin.install "gel-cli-7.1.0-alpha.1+a8d565b" => "gel-testing"
22+
end
23+
else
24+
odie "Unsupported CPU architecture!"
25+
end
26+
end
27+
28+
on_linux do
29+
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
30+
url "https://packages.geldata.com/archive/aarch64-unknown-linux-musl.testing/gel-cli-7.1.0-alpha.1+5f95e8a",
31+
using: :nounzip
32+
sha256 "be74eccd0da295dc9ec613cc3807a196e8921a260cb4b78b472a72ff04bfcc8a"
33+
34+
def install
35+
bin.install "gel-cli-7.1.0-alpha.1+5f95e8a" => "gel-testing"
36+
end
37+
elsif Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
38+
url "https://packages.geldata.com/archive/x86_64-unknown-linux-musl.testing/gel-cli-7.1.0-alpha.1+073c70b",
39+
using: :nounzip
40+
sha256 "d892af584470451c1e64d669a0e4288be0ba7c36a0d00d1d9dfbfa3db5d3f17c"
41+
42+
def install
43+
bin.install "gel-cli-7.1.0-alpha.1+073c70b" => "gel-testing"
44+
end
45+
else
46+
odie "Unsupported CPU architecture!"
47+
end
48+
end
49+
50+
test do
51+
system "#{bin}/gel-testing", "--version"
52+
end
53+
end

Formula/gel-cli.rb

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
class GelCli < Formula
2+
desc "Latest release of the Gel command-line client (gel)"
3+
homepage "https://github.com/geldata/gel-cli"
4+
version "7.0.3"
5+
6+
on_macos do
7+
if Hardware::CPU.physical_cpu_arm64?
8+
url "https://packages.geldata.com/archive/aarch64-apple-darwin/gel-cli-7.0.3+79e11b7",
9+
using: :nounzip
10+
sha256 "e8c30918217f872f852f495fdc0dc35c79b48a59035309ab0a8befb4a423b1b2"
11+
12+
def install
13+
bin.install "gel-cli-7.0.3+79e11b7" => "gel"
14+
end
15+
elsif Hardware::CPU.intel?
16+
url "https://packages.geldata.com/archive/x86_64-apple-darwin/gel-cli-7.0.3+79e11b7",
17+
using: :nounzip
18+
sha256 "592c980a1762d8329f59c0cb8be4d7d0c7607f3221877ecdde71897445819d4c"
19+
20+
def install
21+
bin.install "gel-cli-7.0.3+79e11b7" => "gel"
22+
end
23+
else
24+
odie "Unsupported CPU architecture!"
25+
end
26+
end
27+
28+
on_linux do
29+
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
30+
url "https://packages.geldata.com/archive/aarch64-unknown-linux-musl/gel-cli-7.0.3+df3d924",
31+
using: :nounzip
32+
sha256 "37b178ced6c8372228e0064c8ffc80090f7d3e41dbc6b2053f973b5169f30507"
33+
34+
def install
35+
bin.install "gel-cli-7.0.3+df3d924" => "gel"
36+
end
37+
elsif Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
38+
url "https://packages.geldata.com/archive/x86_64-unknown-linux-musl/gel-cli-7.0.3+83ce17b",
39+
using: :nounzip
40+
sha256 "6353e9ddefc7e973c2c3eb750b5fc9b4a81f1a9d0765e304d7e00e7e1348836d"
41+
42+
def install
43+
bin.install "gel-cli-7.0.3+83ce17b" => "gel"
44+
end
45+
else
46+
odie "Unsupported CPU architecture!"
47+
end
48+
end
49+
50+
test do
51+
system "#{bin}/gel", "--version"
52+
end
53+
end

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# EdgeDB Homebrew Tap
1+
# Gel Homebrew Tap
22

33
There's two kinds of formulae:
44

5-
* default, e.g. `edgedb-cli` which is the latest released version
6-
* nightly, e.g. `edgedb-cli-nightly` which is the latest available nightly version
5+
* default, e.g. `gel-cli` which is the latest released version
6+
* nightly, e.g. `gel-cli-nightly` which is the latest available nightly version
77

88
## How do I install these formulae?
9-
`brew install edgedb/tap/<formula>`
9+
`brew install geldata/tap/<formula>`
1010

11-
Or `brew tap edgedb/tap` and then `brew install <formula>`.
11+
Or `brew tap geldata/tap` and then `brew install <formula>`.
1212

1313
## Documentation
1414
`brew help`, `man brew` or check [Homebrew's documentation](https://docs.brew.sh).

autoupdate.py

+12-8
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ class InstallRef(TypedDict):
5757

5858

5959
class Package(TypedDict):
60-
basename: str # edgedb-server
60+
basename: str # gel-server
6161
slot: str | None # 1-alpha6-dev5069
62-
name: str # edgedb-server-1-alpha6-dev5069
62+
name: str # gel-server-1-alpha6-dev5069
6363
version: str # 1.0a6.dev5069+g0839d6e8
6464
version_details: Version
6565
version_key: str # 1.0.0~alpha.6~dev.5069.2020091300~nightly
@@ -69,7 +69,7 @@ class Package(TypedDict):
6969
installref: str
7070

7171

72-
INDEX_URL = "https://packages.edgedb.com/archive/.jsonindexes"
72+
INDEX_URL = "https://packages.geldata.com/archive/.jsonindexes"
7373
CURRENT_DIR = pathlib.Path(__file__).parent
7474
VERSION_BLOCKLIST = {"1.0a3"}
7575

@@ -87,7 +87,7 @@ def query_latest_version(index: str) -> Package:
8787
indexes = json.load(url)
8888
versions: dict[Version, Package] = {}
8989
for package in indexes["packages"]:
90-
if not package["name"] == "edgedb-cli":
90+
if not package["name"] == "gel-cli":
9191
continue
9292
if package["version"] in VERSION_BLOCKLIST:
9393
continue
@@ -115,6 +115,8 @@ def get_tpl_data(channel: str) -> dict[str, Any]:
115115
for target in targets
116116
}
117117

118+
print(packages)
119+
118120
versions = {
119121
version_to_str(v["version_details"])
120122
for v in packages.values()
@@ -126,7 +128,7 @@ def get_tpl_data(channel: str) -> dict[str, Any]:
126128
for target, package in packages.items():
127129
for installref in package["installrefs"]:
128130
if installref["encoding"] == "identity":
129-
url = "https://packages.edgedb.com" + installref["ref"]
131+
url = "https://packages.geldata.com" + installref["ref"]
130132
parsed = urllib.parse.urlparse(url)
131133
artifacts[target] = {
132134
"url": url,
@@ -135,6 +137,8 @@ def get_tpl_data(channel: str) -> dict[str, Any]:
135137
}
136138

137139
return {
140+
"name": "gel",
141+
"marketing_name": "Gel",
138142
"version": next(iter(versions)),
139143
"artifacts": artifacts,
140144
"channel": channel,
@@ -156,9 +160,9 @@ def render_formula(path: pathlib.Path, channel: str) -> None:
156160

157161

158162
def main() -> None:
159-
release_cli = CURRENT_DIR / "Formula" / "edgedb-cli.rb"
160-
testing_cli = CURRENT_DIR / "Formula" / "edgedb-cli-testing.rb"
161-
nightly_cli = CURRENT_DIR / "Formula" / "edgedb-cli-nightly.rb"
163+
release_cli = CURRENT_DIR / "Formula" / "gel-cli.rb"
164+
testing_cli = CURRENT_DIR / "Formula" / "gel-cli-testing.rb"
165+
nightly_cli = CURRENT_DIR / "Formula" / "gel-cli-nightly.rb"
162166
render_formula(release_cli, channel="release")
163167
render_formula(testing_cli, channel="testing")
164168
render_formula(nightly_cli, channel="nightly")

0 commit comments

Comments
 (0)