Skip to content

Commit f9b3d48

Browse files
committed
init tctl-brew
0 parents  commit f9b3d48

File tree

6 files changed

+166
-0
lines changed

6 files changed

+166
-0
lines changed

.github/workflows/release.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Triggers on any tag starting with 'v' (e.g., v1.0.0)
7+
8+
jobs:
9+
build:
10+
name: Create Release
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
15+
- name: Get version from tag
16+
id: get_version
17+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
18+
19+
- name: Extract release notes
20+
id: extract_notes
21+
run: |
22+
# Extract changelog section for this version if available
23+
if [ -f CHANGELOG.md ]; then
24+
NOTES=$(awk -v ver=$VERSION '/^## \['$VERSION'\]/{flag=1;next}/^## \[/{flag=0}flag' CHANGELOG.md)
25+
if [ -z "$NOTES" ]; then
26+
NOTES="Release version $VERSION"
27+
fi
28+
else
29+
NOTES="Release version $VERSION"
30+
fi
31+
echo "NOTES<<EOF" >> $GITHUB_ENV
32+
echo "$NOTES" >> $GITHUB_ENV
33+
echo "EOF" >> $GITHUB_ENV
34+
35+
- name: Update formula version
36+
run: |
37+
sed -i 's/version "[0-9]\+\.[0-9]\+\.[0-9]\+"/version "'$VERSION'"/' Formula/tctl.rb
38+
39+
# Get new checksums for the binaries
40+
INTEL_URL="https://binaries.dl.tetrate.io/public/raw/versions/darwin-amd64-$VERSION/tctl"
41+
ARM_URL="https://binaries.dl.tetrate.io/public/raw/versions/darwin-arm64-$VERSION/tctl"
42+
43+
mkdir -p /tmp/tctl-checksums
44+
curl -s -L -o /tmp/tctl-checksums/tctl-intel "$INTEL_URL"
45+
curl -s -L -o /tmp/tctl-checksums/tctl-arm "$ARM_URL"
46+
47+
INTEL_SHA=$(shasum -a 256 /tmp/tctl-checksums/tctl-intel | cut -d ' ' -f 1)
48+
ARM_SHA=$(shasum -a 256 /tmp/tctl-checksums/tctl-arm | cut -d ' ' -f 1)
49+
50+
# Update the SHA256 checksums in the formula
51+
sed -i 's/sha256 "[a-f0-9]\{64\}" # Intel/sha256 "'$INTEL_SHA'" # Intel/' Formula/tctl.rb
52+
sed -i 's/sha256 "[a-f0-9]\{64\}" # ARM/sha256 "'$ARM_SHA'" # ARM/' Formula/tctl.rb
53+
54+
- name: Commit formula updates
55+
run: |
56+
git config --local user.email "action@github.com"
57+
git config --local user.name "GitHub Action"
58+
git commit -am "Update formula for version $VERSION"
59+
git push
60+
61+
- name: Create Release
62+
id: create_release
63+
uses: softprops/action-gh-release@v1
64+
with:
65+
name: Release ${{ env.VERSION }}
66+
body: ${{ env.NOTES }}
67+
draft: false
68+
prerelease: false
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tests.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Brew Test
2+
on:
3+
push:
4+
branches: [main, master]
5+
pull_request:
6+
branches: [main, master]
7+
8+
jobs:
9+
test-formula:
10+
runs-on: macos-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Homebrew
16+
run: |
17+
brew update
18+
brew tap --force $GITHUB_REPOSITORY
19+
20+
- name: Test formula
21+
run: brew install -v tctl

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Changelog
2+
3+
All notable changes to the tctl Homebrew formula will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.12.4] - 2025-06-11
9+
### Added
10+
- Initial Homebrew formula for tctl version 1.12.4
11+
- Support for both Intel and Apple Silicon Macs
12+
- Automatic architecture detection

Formula/tctl.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
class Tctl < Formula
2+
desc "Tetrate Service Bridge Command Line Interface"
3+
homepage "https://docs.tetrate.io/service-bridge/reference/cli/guide/"
4+
version "1.12.4"
5+
license "Commercial"
6+
7+
if Hardware::CPU.intel?
8+
url "https://binaries.dl.tetrate.io/public/raw/versions/darwin-amd64-#{version}/tctl"
9+
sha256 "0ec0636c2633fb24d7a829a6a444c7e3ec82c82f80cb4633b0216955d7912bfe" # Intel
10+
else
11+
url "https://binaries.dl.tetrate.io/public/raw/versions/darwin-arm64-#{version}/tctl"
12+
sha256 "ca03442c75e6c7c166c16d7288e2856432647a6c278b8932772aa2a280f72f28" # ARM
13+
end
14+
15+
def install
16+
bin.install "tctl"
17+
end
18+
19+
test do
20+
assert_match version.to_s, shell_output("#{bin}/tctl version", 2)
21+
end
22+
end

LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Tetrate Service Bridge CLI Tap Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
23+
Note: This license applies only to the Homebrew formula and repository code.
24+
The tctl binary itself is subject to its own license terms from Tetrate.

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Homebrew Tap for Tetrate Service Bridge CLI (tctl)
2+
3+
This repository contains the Homebrew formula for installing the Tetrate Service Bridge CLI tool (`tctl`).
4+
5+
## Usage
6+
7+
```bash
8+
# Add this tap to your Homebrew
9+
brew tap smarunich/tctl-brew
10+
11+
# Install tctl
12+
brew install tctl
13+
```
14+
15+
## Documentation
16+
17+
For more information about using `tctl`, please refer to the [official documentation](https://docs.tetrate.io/service-bridge/reference/cli/guide/).

0 commit comments

Comments
 (0)