I’m build an internal tool for use at my company. The tool is written in python and uses poetry for dependency management. I’d like to use brew
for distributing the tool to anyone at the company, where we use a private github org. I seem to be getting close, but I keep getting stuck on the Github Actions brew test-bot
stage in the pipeline, and trying to follow the error messages has me going in a loop. Here is an example of the formula, as well as the github actions workflow.
These files are at github.com/foo/homebrew-tap
/Formula/[email protected]:
class BarAT070 < Formula
include Language::Python::Virtualenv
desc "whatever"
homepage "https://github.com/foo/bar"
url "[email protected]:foo/bar.git", tag: "v0.7.0", revision: "5bbf5c5c2673d976c8206d5332add7c3xxxxx"
license ""
depends_on "python3"
resource "altgraph" do
url "https://files.pythonhosted.org/packages/de/a8/7145824cf0b9e3c28046520480f207df47e927df83aa9555fb47f8505922/altgraph-0.17.4.tar.gz"
sha256 "1b5afbb98f6c4dcadb2e2ae6ab9fa994bbb8c1d75f4fa96d340f9437ae454406"
end
def install
virtualenv_create(libexec, "python3")
virtualenv_install_with_resources
end
test do
system "#{bin}/bar", "--version"
end
end
/.github/workflows/tests.yml
name: brew test-bot
on:
push:
branches:
- main
pull_request:
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PAT }}
GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PAT }}
jobs:
test-bot:
strategy:
matrix:
os: [ubuntu-22.04, macos-13]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
token: ${{ github.token }}
- name: Set Up Git
run: git config --global credential.helper store && echo "https://[email protected]" >> ~/.git-credentials
- name: Cache Homebrew Bundler RubyGems
uses: actions/cache@v4
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ runner.os }}-rubygems-
- run: brew test-bot --only-cleanup-before
- run: brew test-bot --only-setup
- run: brew test-bot --only-tap-syntax
- run: brew test-bot --only-formulae
if: github.event_name == 'pull_request'
- name: Upload bottles as artifact
if: always() && github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: bottles_${{ matrix.os }}
path: '*.bottle.*'
I keep failing on the brew test-bot --only-formulae
stage, any typically with some sort of github.com/foo/bar doesn't exist
or 404 on trying to clone the release. as you can see, I have all of the tokens set correctly, as well as a new Personal Access Token with repo scope that I have there as a secret, and still no luck. Has anyone here ever gotten this to work for them? Any examples of working Formulas for private homebrew taps tapping private github repos would be highly appreciated. Thanks!