homebrew-core/.github/workflows/publish-commit-bottles.yml

65 lines
2.3 KiB
YAML

name: Publish and commit bottles
on:
workflow_dispatch:
inputs:
pull_request:
description: Pull request number
required: true
args:
description: 'Extra arguments to `brew pr-pull`'
default: ''
env:
HOMEBREW_FORCE_HOMEBREW_ON_LINUX: 1
jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Post comment once started
uses: Homebrew/actions/post-comment@master
with:
token: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
issue: ${{github.event.inputs.pull_request}}
body: ':shipit: @${{github.actor}} has [triggered a merge](${{github.event.repository.html_url}}/actions/runs/${{github.run_id}}).'
bot_body: ':robot: A scheduled task has [triggered a merge](${{github.event.repository.html_url}}/actions/runs/${{github.run_id}}).'
bot: BrewTestBot
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Configure Git user
uses: Homebrew/actions/git-user-config@master
- name: Pull bottles
env:
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
HOMEBREW_BINTRAY_USER: brewtestbot
HOMEBREW_BINTRAY_KEY: ${{secrets.HOMEBREW_BINTRAY_KEY}}
run: brew pr-pull --debug ${{github.event.inputs.args}} ${{github.event.inputs.pull_request}}
- name: Push commits
uses: Homebrew/actions/git-try-push@master
with:
token: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
- name: Post comment on failure
if: ${{!success()}}
uses: Homebrew/actions/post-comment@master
with:
token: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
issue: ${{github.event.inputs.pull_request}}
body: ':warning: @${{github.actor}} bottle publish [failed](${{github.event.repository.html_url}}/actions/runs/${{github.run_id}}).'
bot_body: ':warning: Bottle publish [failed](${{github.event.repository.html_url}}/actions/runs/${{github.run_id}}).'
bot: BrewTestBot
- name: Dismiss approvals on failure
if: ${{!success()}}
uses: Homebrew/actions/dismiss-approvals@master
with:
token: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
pr: ${{github.event.inputs.pull_request}}
message: 'bottle publish failed'