Repository navigation
63 lines (56 loc) · 2.3 KB
/
Copy pathpublish-commit-bottles.yml
File metadata and controls
63 lines (56 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Publish and commit bottles
on:
pull_request_target:
types:
- labeled
jobs:
pr-pull:
if: contains(github.event.pull_request.labels.*.name, 'CI-merge')
runs-on: ubuntu-latest
steps:
- name: Post comment once started
uses: Homebrew/actions/post-comment@main
with:
token: ${{ github.token }}
issue: ${{ github.event.pull_request.number }}
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
uses: Homebrew/actions/setup-homebrew@main
- name: Set up git
uses: Homebrew/actions/git-user-config@main
- name: Pull bottles
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_GITHUB_PACKAGES_USER: maxim-belkin
HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ github.token }}
HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }}
PULL_REQUEST: ${{ github.event.pull_request.number }}
run: |
brew pr-pull --debug --tap="$GITHUB_REPOSITORY" --root-url="https://ghcr.io/v2/maxim-belkin/xorg" "$PULL_REQUEST"
- name: Push commits
uses: Homebrew/actions/git-try-push@main
with:
token: ${{ github.token }}
branch: main
- name: Post comment on failure
if: ${{!success()}}
uses: Homebrew/actions/post-comment@main
with:
token: ${{ github.token }}
issue: ${{ github.event.pull_request.number }}
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: Remove label
if: always()
uses: actions/github-script@v7
with:
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'CI-merge'
})