Skip to content

Commit db30fe6

Browse files
ncrmroclaude
andcommitted
Initial homebrew tap setup
- Add Formula/deepwork.rb for version 0.3.1 - Add update-formula.sh script to update from PyPI - Add GitHub workflow to automate formula updates - Add flake.nix for development environment Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0 parents  commit db30fe6

7 files changed

Lines changed: 217 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test Formula
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Test formula in Docker
16+
run: |
17+
docker run --rm -v "${{ github.workspace }}:/tap" homebrew/brew:latest bash -c '
18+
set -euo pipefail
19+
20+
# Add the local tap
21+
brew tap-new --no-git local/deepwork
22+
cp /tap/Formula/deepwork.rb "$(brew --repository)/Library/Taps/local/homebrew-deepwork/Formula/"
23+
24+
# Audit the formula
25+
echo "==> Auditing formula..."
26+
brew audit --strict local/deepwork/deepwork || true
27+
28+
# Install the formula
29+
echo "==> Installing formula..."
30+
brew install --verbose local/deepwork/deepwork
31+
32+
# Test the formula
33+
echo "==> Testing formula..."
34+
brew test local/deepwork/deepwork
35+
36+
# Verify the binary works
37+
echo "==> Verifying binary..."
38+
deepwork --help
39+
40+
echo "==> All tests passed!"
41+
'
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Update Formula
2+
3+
on:
4+
repository_dispatch:
5+
types: [update-formula]
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Version to update to (leave empty for latest)'
10+
required: false
11+
type: string
12+
13+
jobs:
14+
update:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Get version
20+
id: version
21+
run: |
22+
if [[ -n "${{ inputs.version }}" ]]; then
23+
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
24+
elif [[ -n "${{ github.event.client_payload.version }}" ]]; then
25+
echo "version=${{ github.event.client_payload.version }}" >> $GITHUB_OUTPUT
26+
else
27+
VERSION=$(curl -sL "https://pypi.org/pypi/deepwork/json" | jq -r '.info.version')
28+
echo "version=$VERSION" >> $GITHUB_OUTPUT
29+
fi
30+
31+
- name: Update formula
32+
run: |
33+
chmod +x scripts/update-formula.sh
34+
./scripts/update-formula.sh "${{ steps.version.outputs.version }}"
35+
36+
- name: Create Pull Request
37+
uses: peter-evans/create-pull-request@v7
38+
with:
39+
commit-message: "Update deepwork to ${{ steps.version.outputs.version }}"
40+
title: "Update deepwork to ${{ steps.version.outputs.version }}"
41+
body: |
42+
Automated update of the deepwork formula to version ${{ steps.version.outputs.version }}.
43+
44+
PyPI: https://pypi.org/project/deepwork/${{ steps.version.outputs.version }}/
45+
branch: update-deepwork-${{ steps.version.outputs.version }}
46+
delete-branch: true

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Nix
2+
result
3+
result-*
4+
.direnv/
5+
6+
# OS
7+
.DS_Store

Formula/deepwork.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
class Deepwork < Formula
2+
include Language::Python::Virtualenv
3+
4+
desc "Framework for enabling AI agents to perform complex, multi-step work tasks"
5+
homepage "https://github.com/Unsupervisedcom/deepwork"
6+
url "https://files.pythonhosted.org/packages/f9/dd/f0d7f6aaa535869401cc1de714ec88f7a025f43bb32a1cc352c073ff4a2c/deepwork-0.3.1.tar.gz"
7+
sha256 "04bee2459d992ea424328bfb6883c241b58637a19a9650ca2f561f492c718287"
8+
license "BSL-1.1"
9+
10+
depends_on "python@3.11"
11+
12+
def install
13+
# Create venv with pip included
14+
system "python3.11", "-m", "venv", libexec
15+
# Install deepwork and all dependencies
16+
system libexec/"bin/pip", "install", "--no-cache-dir", buildpath
17+
# Link the binary
18+
(bin/"deepwork").write_env_script libexec/"bin/deepwork", PATH: "#{libexec}/bin:$PATH"
19+
end
20+
21+
test do
22+
system bin/"deepwork", "--version"
23+
end
24+
end

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Homebrew Tap for DeepWork
2+
3+
This is the official Homebrew tap for [DeepWork](https://github.com/Unsupervisedcom/deepwork), a framework for enabling AI agents to perform complex, multi-step work tasks.
4+
5+
## Installation
6+
7+
```bash
8+
brew tap unsupervisedcom/deepwork
9+
brew install deepwork
10+
```
11+
12+
## Updating
13+
14+
```bash
15+
brew update
16+
brew upgrade deepwork
17+
```
18+
19+
## Uninstallation
20+
21+
```bash
22+
brew uninstall deepwork
23+
brew untap unsupervisedcom/deepwork
24+
```
25+
26+
## License
27+
28+
DeepWork is licensed under the Business Source License 1.1 (BSL-1.1).

scripts/test-formula.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Test the Homebrew formula using the official homebrew/brew Docker image
5+
# Usage: ./scripts/test-formula.sh
6+
7+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8+
REPO_DIR="$(dirname "$SCRIPT_DIR")"
9+
10+
echo "Testing deepwork formula..."
11+
12+
docker run --rm -v "$REPO_DIR:/tap" homebrew/brew:latest bash -c '
13+
set -euo pipefail
14+
15+
# Add the local tap
16+
brew tap-new --no-git local/deepwork
17+
cp /tap/Formula/deepwork.rb "$(brew --repository)/Library/Taps/local/homebrew-deepwork/Formula/"
18+
19+
# Audit the formula
20+
echo "==> Auditing formula..."
21+
brew audit --strict local/deepwork/deepwork || true
22+
23+
# Install the formula
24+
echo "==> Installing formula..."
25+
brew install --verbose local/deepwork/deepwork
26+
27+
# Test the formula
28+
echo "==> Testing formula..."
29+
brew test local/deepwork/deepwork
30+
31+
# Verify the binary works
32+
echo "==> Verifying binary..."
33+
deepwork --help
34+
35+
echo "==> All tests passed!"
36+
'

scripts/update-formula.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Update the Homebrew formula with the latest version from PyPI
5+
# Usage: ./scripts/update-formula.sh [version]
6+
# If no version is provided, fetches the latest from PyPI
7+
8+
FORMULA_PATH="Formula/deepwork.rb"
9+
10+
if [[ -n "${1:-}" ]]; then
11+
VERSION="$1"
12+
else
13+
VERSION=$(curl -sL "https://pypi.org/pypi/deepwork/json" | jq -r '.info.version')
14+
fi
15+
16+
echo "Updating formula to version $VERSION"
17+
18+
# Get the tarball URL and SHA256
19+
PYPI_DATA=$(curl -sL "https://pypi.org/pypi/deepwork/${VERSION}/json")
20+
URL=$(echo "$PYPI_DATA" | jq -r '.urls[] | select(.packagetype == "sdist") | .url')
21+
SHA256=$(echo "$PYPI_DATA" | jq -r '.urls[] | select(.packagetype == "sdist") | .digests.sha256')
22+
23+
if [[ -z "$URL" || -z "$SHA256" ]]; then
24+
echo "Error: Could not fetch tarball info for version $VERSION"
25+
exit 1
26+
fi
27+
28+
echo "URL: $URL"
29+
echo "SHA256: $SHA256"
30+
31+
# Update the formula
32+
sed -i "s|url \"https://files.pythonhosted.org/packages/[^\"]*\"|url \"$URL\"|" "$FORMULA_PATH"
33+
sed -i "s|sha256 \"[a-f0-9]*\"|sha256 \"$SHA256\"|" "$FORMULA_PATH"
34+
35+
echo "Formula updated successfully"

0 commit comments

Comments
 (0)