Tap Bottles - How to publish after --ci-upload to Bintray

Hi there!

Following on my previous post, I’ve started from scratch to try to understand the process of building and publishing bottles for taps on Azure CI.

Here are the prerequisites:

My CI process has two stages:

  • First stage: create the bottle with brew test-bot formula for Mojave and High Sierra and save the .json & .tar.gz files for the next step
  • Second stage: retrieve the bottle’s files and upload them to Bintray with brew test-bot --ci-upload

Here are the corresponding .yml files:

I’ve created a PR (link here) to build the bottles and it has passed all the stages (build results). The bottles have been published to Bintray as unpublished, a release tag has been created (link here), and the commits from the PR are now in master as well as the bottles (link here).

Now I’m stuck at…

How do I publish the bottles and close the PR?..

So I have a few questions:

  1. Is this the right workflow?
  2. I’ve read that I’m now supposed to use brew pull --bottle, but when I do on my computer, either on master or on the PR branch, it fails. Why is that?
  3. What’s the best way to now publish the bottles?

The described workflow works because I’ve made the PR and I know I want to merge the changes at some point.

Now, if someone else makes a PR, how should the workflow handle that? It is not supposed to build the bottles and make the changes to master, so I must be missing something…

Any help would be greatly appreciated!

Thanks a lot!
– Ladislas

Are you using the Free/OSS plan on Bintray? I had trouble with it, until I realized I needed to set the “license” field of a package in my Bintray repository before it would work properly.

Otherwise, try running the publish step with --verbose and diagnose it that way by re-running the curl steps that brew executes. Don’t directly paste output online since your Bintray key is not censored in verbose / debug mode.

tl;dr - I’ve found a solution but I’m wondering if we would need to change brew-test-bot.rb

@jonchang Thanks for your help!

Yes and the license is set to Apache 2.0.

I’ve tried again, simulating a version update in hello-world by running:

brew bump-formula-pr --strict --url=https://github.com/ladislas/hello-world/archive/2.0.0.tar.gz  hello-world

Which created the following PR: https://github.com/ladislas/homebrew-hello-world/pull/6

I ran locally:

brew pull --verbose --bottle --warn-on-publish-failure --bintray-org=ladislas --test-bot-user=ladislas https://github.com/ladislas/homebrew-hello-world/pull/6

And here is the ouput:

$ brew pull --verbose --bottle --warn-on-publish-failure --bintray-org=ladislas --test-bot-user=ladislas https://github.com/ladislas/homebrew-hello-world/pull/6
==> Fetching patch
Patch: https://github.com/ladislas/homebrew-hello-world/pull/6.patch
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   153    0   153    0     0    574      0 --:--:-- --:--:-- --:--:--   575
100   912    0   912    0     0   1573      0 --:--:-- --:--:-- --:--:--  1573
==> Applying patch
git am --whitespace=fix -3 /Users/ladislas/Library/Caches/Homebrew/6.patch
Applying: hello-world 2.0.0
Using index info to reconstruct a base tree...
M	Formula/hello-world.rb
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
==> Patch closes issue #6
==> Patch changed:
git diff-tree -r --stat bacdb2e HEAD

And I ended on the pull-bottle-6 branch.

My remote master branch also had the changes as brew test-bot --ci-upload pushes those to master

As the patch/tag was also correctly uploaded to github (https://github.com/ladislas/homebrew-hello-world/releases/tag/pr-6), I tried the following:

  • reset local master to before the CI pushed the commit
  • force push master to remote
  • expose bintray username and key locally and then run brew pull --bottle like previously


It works! :tada:

So my understanding is that test_ci_upload should not push the changes to master if we don’t use a test-bot account/fork but just push the tag with the changes.

Could it be that or am I missing something obvious?


I can confirm the good news! :tada: :slight_smile:

Only pushing tags to the remote and not master:master fixed the issue. When the test passes, I can then run brew pull --bottle and it works like a charm! :slight_smile:

I’ll make a PR to homebrew/test-bot to try and fix the issue upstream.