Skip to content

Commit 725d85a

Browse files
sionsmithclaude
andcommitted
fix: use gh CLI for private repo asset downloads in homebrew job
The repo is private so curl cannot download release assets without auth. Switch to `gh release download` which uses GH_TOKEN automatically. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 94205e1 commit 725d85a

4 files changed

Lines changed: 21 additions & 22 deletions

File tree

.github/workflows/release.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,28 +80,27 @@ jobs:
8080
- name: Update Homebrew tap
8181
env:
8282
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
83+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8384
run: |
8485
set -euo pipefail
8586
VERSION="${GITHUB_REF_NAME#v}"
86-
BASE_URL="https://github.com/osodevops/keito-cli/releases/download/${GITHUB_REF_NAME}"
8787
88-
# Download each binary tarball and compute SHA256
89-
# Retry up to 5 times with 15s delay to allow CDN propagation
90-
download_with_retry() {
91-
local url="$1" output="$2"
92-
for i in 1 2 3 4 5; do
93-
if curl -fsSL "$url" -o "$output"; then
94-
return 0
95-
fi
96-
echo "Attempt $i failed for $output, retrying in 15s..."
97-
sleep 15
98-
done
99-
echo "Failed to download $output after 5 attempts"
100-
return 1
101-
}
102-
download_with_retry "${BASE_URL}/keito-aarch64-apple-darwin.tar.gz" arm64.tar.gz
103-
download_with_retry "${BASE_URL}/keito-x86_64-apple-darwin.tar.gz" x86_64_mac.tar.gz
104-
download_with_retry "${BASE_URL}/keito-x86_64-unknown-linux-gnu.tar.gz" x86_64_linux.tar.gz
88+
# Download release assets using gh CLI (handles private repo auth)
89+
gh release download "${GITHUB_REF_NAME}" \
90+
--repo "${{ github.repository }}" \
91+
--pattern "keito-aarch64-apple-darwin.tar.gz" \
92+
--output arm64.tar.gz
93+
gh release download "${GITHUB_REF_NAME}" \
94+
--repo "${{ github.repository }}" \
95+
--pattern "keito-x86_64-apple-darwin.tar.gz" \
96+
--output x86_64_mac.tar.gz
97+
gh release download "${GITHUB_REF_NAME}" \
98+
--repo "${{ github.repository }}" \
99+
--pattern "keito-x86_64-unknown-linux-gnu.tar.gz" \
100+
--output x86_64_linux.tar.gz
101+
102+
# Public download URLs for the formula (used after repo goes public)
103+
BASE_URL="https://github.com/osodevops/keito-cli/releases/download/${GITHUB_REF_NAME}"
105104
106105
SHA_ARM64=$(sha256sum arm64.tar.gz | awk '{print $1}')
107106
SHA_X86_64_MAC=$(sha256sum x86_64_mac.tar.gz | awk '{print $1}')

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/),
66
and this project adheres to [Semantic Versioning](https://semver.org/).
77

8-
## [0.1.1] - 2026-03-05
8+
## [0.1.2] - 2026-03-05
99

1010
### Added
1111

@@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
1515
### Fixed
1616

1717
- Commit `Cargo.lock` so `rustsec/audit-check` can run in CI
18-
- Add retry logic to Homebrew tap job to handle GitHub CDN propagation delays
18+
- Use `gh release download` for Homebrew tap job (fixes private repo asset downloads)
1919

2020
## [0.1.0] - 2026-03-05
2121

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "keito-cli"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
edition = "2021"
55
description = "CLI for AI agents and humans to track billable time against the Keito platform"
66
license = "MIT"

0 commit comments

Comments
 (0)