-
Notifications
You must be signed in to change notification settings - Fork 457
87 lines (78 loc) · 3.09 KB
/
dispatch-build-bottle.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Build bottles from 'brew request-bottle' trigger.
on: repository_dispatch
jobs:
bottling:
runs-on: ubuntu-latest
container:
image: homebrew/ubuntu16.04:master
env:
HOMEBREW_PATCHELF_RB: 1
HOMEBREW_GIT_NAME: BrewTestBot
HOMEBREW_GIT_EMAIL: '[email protected]'
HOMEBREW_DEVELOPER: 1
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
# Printing these details should always be the first step listed.
- name: ${{github.event.client_payload.formula}}
id: print_details
run: |
echo formula=${{github.event.client_payload.formula}}
echo sender=${{github.event.sender.login}}
echo name=${{github.event.client_payload.name}}
echo ignore-errors=${{github.event.client_payload.ignore_errors}}
echo issue=${{github.event.client_payload.issue}}
echo "::set-output name=repo::$(brew --repo ${{github.repository}})"
- name: Setup git
uses: Homebrew/actions/git-user-config@master
- name: Build bottles
env:
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
mkdir ~/bottles
cd ~/bottles
brew update-reset
brew tap linuxbrew/xorg
brew test-bot \
--only-formulae \
--keep-old \
--skip-recursive-dependents \
${{github.event.client_payload.formula}}
- name: Copy bottles
if: always()
run: |
cp -a ~/bottles $GITHUB_WORKSPACE
- name: Upload bottles
if: always()
uses: actions/upload-artifact@v2
with:
name: bottles
path: bottles
- name: Upload bottles to Bintray
env:
HOMEBREW_BINTRAY_USER: linuxbrewtestbot
HOMEBREW_BINTRAY_KEY: ${{secrets.HOMEBREW_BINTRAY_KEY}}
if: success() || github.event.client_payload.ignore_errors
run: |
cd ~/bottles
brew update-reset $(brew --repo ${{github.repository}})
brew pr-upload \
--bintray-org=linuxbrew \
--keep-old \
--verbose \
--debug
- name: Push commits
uses: Homebrew/actions/git-try-push@master
if: success() || github.event.client_payload.ignore_errors
with:
directory: ${{ steps.print_details.outputs.repo }}
token: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
- name: Post comment on failure
if: ${{!success() && github.event.client_payload.issue > 0}}
uses: Homebrew/actions/post-comment@master
with:
token: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
issue: ${{github.event.client_payload.issue}}
body: ':warning: @${{github.actor}} bottle request for ${{github.event.client_payload.formula}} [failed](${{github.event.repository.html_url}}/actions/runs/${{github.run_id}}).'
bot_body: ':warning: Bottle request for ${{github.event.client_payload.formula}} [failed](${{github.event.repository.html_url}}/actions/runs/${{github.run_id}}).'
bot: BrewTestBot