-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tap-new: enable bottles publishing #8762
Conversation
Also, is it intentional we don't do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is SO COOL 😍
Taps don't have to be git repos. |
Library/Homebrew/dev-cmd/tap-new.rb
Outdated
|
||
- name: Pull bottles | ||
env: | ||
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the default GITHUB_TOKEN
here? Means less setup for tap maintainers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or at least something clever like using it unless it's a PR from a fork?
Library/Homebrew/dev-cmd/tap-new.rb
Outdated
token: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}} | ||
|
||
- name: Delete branch | ||
uses: peter-evans/close-pull@v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if this was something in the Homebrew org.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably simple enough for https://github.com/actions/github-script.
Library/Homebrew/dev-cmd/tap-new.rb
Outdated
When a pull request making changes to a formula (or formulae) becomes green | ||
(all checks passed), then you can publish the built bottles. | ||
To do so, run: | ||
brew pr-publish --tap=#{tap} <pull_request_number> | ||
or trigger the workflow via GitHub UI in Actions tab. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this text ought to go in the README, rather than a one-time thing that's printed to the terminal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea or, better still, be something that's linked to in our documentation so we can update it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😻
Library/Homebrew/dev-cmd/tap-new.rb
Outdated
|
||
- name: Pull bottles | ||
env: | ||
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or at least something clever like using it unless it's a PR from a fork?
Library/Homebrew/dev-cmd/tap-new.rb
Outdated
token: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}} | ||
|
||
- name: Delete branch | ||
uses: peter-evans/close-pull@v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
Library/Homebrew/dev-cmd/tap-new.rb
Outdated
When a pull request making changes to a formula (or formulae) becomes green | ||
(all checks passed), then you can publish the built bottles. | ||
To do so, run: | ||
brew pr-publish --tap=#{tap} <pull_request_number> | ||
or trigger the workflow via GitHub UI in Actions tab. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea or, better still, be something that's linked to in our documentation so we can update it.
This is true but I think, by default at least, |
Library/Homebrew/dev-cmd/tap-new.rb
Outdated
uses: actions/cache@v1 | ||
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- | ||
|
||
- name: Install Homebrew Bundler RubyGems | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: brew install-bundler-gems |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does something like this (👇 ) achieve the desired behavior?
run: brew install-bundler-gems | |
if: github.repository_owner == 'Homebrew' || steps.cache.outputs.cache-hit != 'true' | |
run: brew install-bundler-gems |
4cf6d15
to
daabae9
Compare
Changes since almost 2 weeks:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some very minor suggestions here but I'm happy for this to ship whenever you're happy with it and it's tested. Great work @dawidd6!
Library/Homebrew/dev-cmd/tap-new.rb
Outdated
- labeled | ||
jobs: | ||
pr-pull: | ||
if: contains(github.event.pull_request.labels.*.name, 'ok') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if: contains(github.event.pull_request.labels.*.name, 'ok') | |
if: contains(github.event.pull_request.labels.*.name, 'homebrew-publish-bottles') |
or something? I'm pretty open to anything but something more descriptive and/or homebrew-specific might be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imma name it as pr-pull
by default, it matches the workflow name and is short enough.
Library/Homebrew/dev-cmd/tap-new.rb
Outdated
|
||
When a pull request making changes to a formula (or formulae) becomes green | ||
(all checks passed), then you can publish the built bottles. | ||
To do so, label your PR as 'ok' and the workflow will be triggered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To do so, label your PR as 'ok' and the workflow will be triggered. | |
To do so, label your PR as #{label} and the workflow will be triggered. |
and could share the variable above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better, it could be an option with default value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, good idea 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, for a counterpoint: I tend to think it's not worth adding options until someone requests them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I request it 😄
daabae9
to
a2e6bef
Compare
to GitHub Releases
a2e6bef
to
843dffe
Compare
I encountered this error, while testing the publishing workflow:
|
It's working: |
We now support bottles publishing to GitHub Releases.
Add a workflow for that and modify
tests.yml
a bit, so users can have bottles in their taps too and be happier.brew style
with your changes locally?brew tests
with your changes locally?