Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unnotarized-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
python3 -c 'import os,re; assert re.fullmatch(r"[1-9][0-9]*", os.environ["CANDIDATE_RUN_ID"])'
- run: python3 -m pip install --require-hashes -r distribution/dmg/requirements.txt
- name: Download existing candidate without rebuilding it
run: gh run download "$CANDIDATE_RUN_ID" --repo Brendan-Lim/ContextLens --name "official-candidate-$RELEASE_VERSION" --dir "$RUNNER_TEMP/official-assets"
run: gh run download "$CANDIDATE_RUN_ID" --repo bstack-tools/ContextLens --name "official-candidate-$RELEASE_VERSION" --dir "$RUNNER_TEMP/official-assets"
- name: Audit reviewed source and verify acceptance before promotion
run: |
python3 scripts/audit-public-files.py
Expand Down
4 changes: 2 additions & 2 deletions distribution/homebrew/Casks/contextlens-preview.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ cask "contextlens-preview" do
version "__VERSION__,__ASSET_ID__"
sha256 "__SHA256__"

url "https://api.github.com/repos/Brendan-Lim/ContextLens/releases/assets/#{version.csv.second}",
url "https://api.github.com/repos/bstack-tools/ContextLens/releases/assets/#{version.csv.second}",
header: "Accept: application/octet-stream"
name "ContextLens Preview"
desc "Unnotarized preview of local window capture for coding agents"
homepage "https://github.com/Brendan-Lim/ContextLens/"
homepage "https://github.com/bstack-tools/ContextLens/"

livecheck do
skip "Preview releases are updated explicitly after verification"
Expand Down
4 changes: 2 additions & 2 deletions distribution/homebrew/Casks/contextlens-unnotarized.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ cask "contextlens" do
version "__VERSION__,__ASSET_ID__"
sha256 "__SHA256__"

url "https://api.github.com/repos/Brendan-Lim/ContextLens/releases/assets/#{version.csv.second}",
url "https://api.github.com/repos/bstack-tools/ContextLens/releases/assets/#{version.csv.second}",
header: "Accept: application/octet-stream"
name "ContextLens"
desc "Capture and annotate window states for coding agents"
homepage "https://github.com/Brendan-Lim/ContextLens"
homepage "https://github.com/bstack-tools/ContextLens"

conflicts_with cask: "contextlens-preview"
depends_on arch: :arm64
Expand Down
4 changes: 2 additions & 2 deletions distribution/homebrew/Casks/contextlens.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ cask "contextlens" do
version "__VERSION__"
sha256 "__SHA256__"

url "https://github.com/Brendan-Lim/ContextLens/releases/download/v#{version}/ContextLens-#{version}-arm64.zip"
url "https://github.com/bstack-tools/ContextLens/releases/download/v#{version}/ContextLens-#{version}-arm64.zip"
name "ContextLens"
desc "Capture and annotate window states for coding agents"
homepage "https://github.com/Brendan-Lim/ContextLens"
homepage "https://github.com/bstack-tools/ContextLens"

depends_on arch: :arm64
depends_on macos: ">= :sonoma"
Expand Down
2 changes: 1 addition & 1 deletion docs/preview-releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ During verification GitHub's browser asset URL returned HTTP 504, while the offi
```sh
curl --fail --location --header 'Accept: application/octet-stream' \
--output ContextLens-0.3.0-preview.1-arm64.zip \
https://api.github.com/repos/Brendan-Lim/ContextLens/releases/assets/723563642
https://api.github.com/repos/bstack-tools/ContextLens/releases/assets/723563642
shasum -a 256 ContextLens-0.3.0-preview.1-arm64.zip
```

Expand Down
2 changes: 1 addition & 1 deletion scripts/preview-release.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from release import ROOT, archive_members, metadata, require, run, verify

REPO = 'Brendan-Lim/ContextLens'
REPO = 'bstack-tools/ContextLens'
TRUST = 'unnotarized-adhoc-preview'


Expand Down
4 changes: 2 additions & 2 deletions scripts/publish-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ Homebrew installation becomes available after the tap update is validated.
EOF
# A draft ensures assets arrive before visibility. Never use --clobber or --force.
# gh creates the new tag at this exact source commit; no existing tag is moved.
gh release create "v$version" --repo Brendan-Lim/ContextLens --target "$(git rev-parse HEAD)" --draft --title "ContextLens $version" --notes-file "$notes" \
gh release create "v$version" --repo bstack-tools/ContextLens --target "$(git rev-parse HEAD)" --draft --title "ContextLens $version" --notes-file "$notes" \
"$asset_dir/$asset" "$asset_dir/$asset.sha256" "$asset_dir/$asset.json"
gh release edit "v$version" --repo Brendan-Lim/ContextLens --draft=false --latest
gh release edit "v$version" --repo bstack-tools/ContextLens --draft=false --latest
2 changes: 1 addition & 1 deletion scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def preflight(version):
tag = 'v' + version
refs = run('git', '-C', ROOT, 'tag', '--list', tag).strip()
require(not refs, 'Version tag already exists; choose a new version')
releases = json.loads(run('gh', 'api', 'repos/Brendan-Lim/ContextLens/releases', '--paginate', '--slurp'))
releases = json.loads(run('gh', 'api', 'repos/bstack-tools/ContextLens/releases', '--paginate', '--slurp'))
require(not any(r['tag_name'] == tag for page in releases for r in page), 'Release already exists')
print('Release source preflight passed: ' + tag)

Expand Down
6 changes: 3 additions & 3 deletions scripts/tests/test_preview_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_cask_requires_actual_sha_and_discloses_trust(self):
text = preview.render_cask(VERSION, 'a' * 64, 123)
self.assertIn('cask "contextlens-preview"', text)
self.assertIn(f'version "{VERSION},123"', text)
self.assertIn('https://api.github.com/repos/Brendan-Lim/ContextLens/releases/assets/#{version.csv.second}', text)
self.assertIn('https://api.github.com/repos/bstack-tools/ContextLens/releases/assets/#{version.csv.second}', text)
self.assertIn('Accept: application/octet-stream', text)
self.assertIn('conflicts_with cask: "contextlens"', text)
self.assertIn('Unnotarized', text)
Expand All @@ -98,9 +98,9 @@ def test_published_preview_and_exact_uploaded_assets_are_required(self):
version = VERSION
name = f'ContextLens-{version}-arm64.zip'
info = dict(tag_name='v' + version, draft=False, prerelease=True, published_at='now',
assets=[dict(id=i, url=f'https://api.github.com/repos/Brendan-Lim/ContextLens/releases/assets/{i}',
assets=[dict(id=i, url=f'https://api.github.com/repos/bstack-tools/ContextLens/releases/assets/{i}',
name=n, state='uploaded', browser_download_url=
f'https://github.com/Brendan-Lim/ContextLens/releases/download/v{version}/{n}')
f'https://github.com/bstack-tools/ContextLens/releases/download/v{version}/{n}')
for i, n in enumerate([name, name + '.sha256', name + '.json'], 123)])
preview.published_assets(info, version)
for change in [dict(draft=True), dict(prerelease=False), dict(assets=[]), dict(tag_name='v' + BASE)]:
Expand Down
8 changes: 4 additions & 4 deletions scripts/update-homebrew.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,22 @@ def main():
require(subprocess.check_output(['git', '-C', str(tap), 'remote', 'get-url', 'origin'], text=True).strip() in ['https://github.com/Brendan-Lim/homebrew-tap.git', 'https://github.com/Brendan-Lim/homebrew-tap', 'git@github.com:Brendan-Lim/homebrew-tap.git'], 'Unexpected tap remote')
require(not subprocess.check_output(['git', '-C', str(tap), 'status', '--porcelain'], text=True).strip(), 'Tap must be clean before updating')
tag = 'v' + args.version
info = json.loads(subprocess.check_output(['gh', 'api', f'repos/Brendan-Lim/ContextLens/releases/tags/{tag}'], text=True))
info = json.loads(subprocess.check_output(['gh', 'api', f'repos/bstack-tools/ContextLens/releases/tags/{tag}'], text=True))
require(info['tag_name'] == tag and not info['draft'] and not info['prerelease'] and info['published_at'], 'A published stable release is required')
name = f'ContextLens-{args.version}-arm64.zip'
official = official_helpers() if args.unnotarized_official else None
assets = official.asset_names(args.version) + ['provenance.json', 'SHA256SUMS', 'acceptance.json'] if official else [name, name + '.sha256', name + '.json']
for asset in assets:
matching = [a for a in info['assets'] if a['name'] == asset]
require(len(matching) == 1 and matching[0]['state'] == 'uploaded', 'Missing or ambiguous release asset')
require(matching[0]['browser_download_url'] == f'https://github.com/Brendan-Lim/ContextLens/releases/download/{tag}/{asset}', 'Unexpected release download URL')
require(matching[0]['browser_download_url'] == f'https://github.com/bstack-tools/ContextLens/releases/download/{tag}/{asset}', 'Unexpected release download URL')
with tempfile.TemporaryDirectory(prefix='contextlens-tap-update-') as temporary:
patterns = [item for asset in assets for item in ['--pattern', asset]]
subprocess.run(['gh', 'release', 'download', tag, '--repo', 'Brendan-Lim/ContextLens', '--dir', temporary, *patterns], check=True)
subprocess.run(['gh', 'release', 'download', tag, '--repo', 'bstack-tools/ContextLens', '--dir', temporary, *patterns], check=True)
receipt = official.verify_assets(temporary) if official else verify_archive(Path(temporary) / name)
if official:
official.acceptance(json.loads((Path(temporary) / 'acceptance.json').read_text()), receipt)
commit = json.loads(subprocess.check_output(['gh', 'api', f'repos/Brendan-Lim/ContextLens/commits/{tag}'], text=True))
commit = json.loads(subprocess.check_output(['gh', 'api', f'repos/bstack-tools/ContextLens/commits/{tag}'], text=True))
require(receipt.get('sourceCommit') == commit['sha'], 'Receipt source commit differs from the published tag')
# Trust the expected signing team, not a receipt's self-asserted trust field.
asset_id = next(a['id'] for a in info['assets'] if a['name'] == name)
Expand Down
Loading