Skip to content

Commit 990e9dd

Browse files
committed
1 parent e4d5353 commit 990e9dd

3 files changed

Lines changed: 46 additions & 12 deletions

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,31 @@ Want to use transitland-lib as a library within another Go-based project? See th
1515
## Usage
1616

1717
See the transitland-lib readme for [CLI usage instructions](https://github.com/interline-io/transitland-lib#usage-as-a-cli-tool).
18+
19+
## For formula maintainers
20+
21+
### Updating to a New Release
22+
23+
When a new version of transitland-lib is released, follow these steps to update the Homebrew formula:
24+
25+
1. **Update the version** in `transitland-lib.rb`:
26+
```ruby
27+
version "v1.2.4" # Change to the new version
28+
```
29+
30+
2. **Get the new SHA256 hashes** using the provided script:
31+
```sh
32+
./get-new-hashes.sh v1.2.4 # Replace with the new version
33+
```
34+
35+
3. **Update the SHA256 hashes** in `transitland-lib.rb` with the output from the script:
36+
- macOS Intel: `f7afff75ffcda082fee5d2669132c72271bb862a086c080c906913d89992debc`
37+
- macOS Apple Silicon: `ab854669644913adda934cd5c62a5bde3b2190eae8c8bffcde6f7d17788ba5be`
38+
- Linux: `0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5`
39+
40+
4. **Test the formula** locally:
41+
```sh
42+
brew install --build-from-source ./transitland-lib.rb
43+
```
44+
45+
5. **Commit and push** the changes to the repository.

get-new-hashes.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Check if version argument is provided
44
if [ -z "$1" ]; then
55
echo "Usage: $0 <version>"
6-
echo "Example: $0 v1.1.2"
6+
echo "Example: $0 v1.2.4"
77
exit 1
88
fi
99

@@ -18,13 +18,13 @@ echo "Downloading files for version ${VERSION}..."
1818

1919
# Download and calculate hash for macOS Intel
2020
echo "macOS Intel:"
21-
curl -L "${BASE_URL}/transitland-macos-intel.zip" -o transitland-macos-intel.zip
22-
sha256sum transitland-macos-intel.zip
21+
curl -L "${BASE_URL}/transitland-macos-intel" -o transitland-macos-intel
22+
sha256sum transitland-macos-intel
2323

2424
# Download and calculate hash for macOS Apple Silicon
2525
echo -e "\nmacOS Apple Silicon:"
26-
curl -L "${BASE_URL}/transitland-macos-apple.zip" -o transitland-macos-apple.zip
27-
sha256sum transitland-macos-apple.zip
26+
curl -L "${BASE_URL}/transitland-macos-apple" -o transitland-macos-apple
27+
sha256sum transitland-macos-apple
2828

2929
# Download and calculate hash for Linux
3030
echo -e "\nLinux:"

transitland-lib.rb

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class TransitlandLib < Formula
22
desc "Library and CLI tool for reading, writing, and processing GTFS transit data"
33
homepage "https://github.com/interline-io/transitland-lib"
4-
version "v1.2.0"
4+
version "v1.2.4"
55
license "GPL-3.0-or-later"
66

77
livecheck do
@@ -15,18 +15,24 @@ class TransitlandLib < Formula
1515
end
1616

1717
if OS.mac? && Hardware::CPU.intel?
18-
url "https://github.com/interline-io/transitland-lib/releases/download/#{version}/transitland-macos-intel.zip"
19-
sha256 "bac537d96e923868f772ee64bc7add997f8be4073b0aba1380407f48a0c3503b"
18+
url "https://github.com/interline-io/transitland-lib/releases/download/#{version}/transitland-macos-intel"
19+
sha256 "f7afff75ffcda082fee5d2669132c72271bb862a086c080c906913d89992debc"
2020
elsif OS.mac? && Hardware::CPU.arm?
21-
url "https://github.com/interline-io/transitland-lib/releases/download/#{version}/transitland-macos-apple.zip"
22-
sha256 "dd1c73c0dfbe47ce9f912e45485737894ee100ad1b6f1a3241c49250796265d0"
21+
url "https://github.com/interline-io/transitland-lib/releases/download/#{version}/transitland-macos-apple"
22+
sha256 "ab854669644913adda934cd5c62a5bde3b2190eae8c8bffcde6f7d17788ba5be"
2323
elsif OS.linux? && Hardware::CPU.intel?
2424
url "https://github.com/interline-io/transitland-lib/releases/download/#{version}/transitland-linux"
25-
sha256 "7968ace15938b2e450af7b8a5d872f52ff119fa1076c96b377ed63c128e04d0a"
25+
sha256 "0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5"
2626
end
2727

2828
def install
29-
bin.install 'transitland'
29+
if OS.mac? && Hardware::CPU.intel?
30+
bin.install 'transitland-macos-intel' => 'transitland'
31+
elsif OS.mac? && Hardware::CPU.arm?
32+
bin.install 'transitland-macos-apple' => 'transitland'
33+
elsif OS.linux? && Hardware::CPU.intel?
34+
bin.install 'transitland-linux' => 'transitland'
35+
end
3036
end
3137

3238
test do

0 commit comments

Comments
 (0)