-
-
Notifications
You must be signed in to change notification settings - Fork 47
executable file
·144 lines (134 loc) · 4.67 KB
/
dispatch-rebottle.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Dispatch rebottle
run-name: Rebuild bottles of ${{ inputs.formula }}
on:
workflow_dispatch:
inputs:
formula:
description: Formula name
required: true
timeout:
description: "Build timeout (in minutes, default: 180 minutes)"
default: "180"
required: false
issue:
description: Issue number, where comment on failure would be posted
required: false
upload:
description: "Upload built bottles? (default: false)"
type: boolean
default: false
required: false
fail-fast:
description: "Fail immediately on a single OS version failure? (default: true)"
type: boolean
default: true
required: false
env:
HOMEBREW_DEVELOPER: 1
HOMEBREW_GITHUB_ACTIONS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_FROM_API: 1
HOMEBREW_RELOCATE_RPATHS: 1
jobs:
bottle:
strategy:
matrix:
include:
- runner: 'macos-13-arm64'
- runner: 'macos-15'
- runner: 'macos-14'
- runner: 'macos-13'
- runner: 'ubuntu-22.04'
container:
image: "ghcr.io/homebrew/ubuntu22.04:master"
options: "--user=linuxbrew -e GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED"
workdir: /github/home
fail-fast: ${{fromJson(github.event.inputs.fail-fast)}}
runs-on: ${{matrix.runner}}
container: ${{matrix.container}}
timeout-minutes: ${{fromJson(github.event.inputs.timeout)}}
defaults:
run:
working-directory: ${{matrix.workdir || github.workspace}}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
BOTTLES_DIR: ${{ matrix.workdir || github.workspace }}/bottles
steps:
- name: ${{github.event.inputs.formula}}
id: print_details
run: |
echo sender=${{github.event.sender.login}}
echo formula=${{github.event.inputs.formula}}
echo timeout=${{github.event.inputs.timeout}}
echo issue=${{github.event.inputs.issue}}
echo upload=${{github.event.inputs.upload}}
- name: Pre-test steps
uses: Homebrew/actions/pre-build@master
with:
bottles-directory: ${{ env.BOTTLES_DIR }}
- name: Run brew test-bot --only-formulae --only-json-tab --skip-online-checks --skip-dependents
working-directory: ${{ env.BOTTLES_DIR }}
env:
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
brew test-bot --only-formulae --only-json-tab --skip-online-checks --skip-dependents --root-url="https://ghcr.io/v2/${{ github.repository_owner }}/extensions" ${{github.event.inputs.formula}}
- name: Post-build steps
if: always()
uses: Homebrew/actions/post-build@master
with:
runner: ${{ matrix.runner }}
bottles-directory: ${{ env.BOTTLES_DIR }}
logs-directory: ${{ env.BOTTLES_DIR }}/logs
upload:
permissions:
contents: write
packages: write
runs-on: ubuntu-22.04
needs: bottle
if: inputs.upload
container:
image: ghcr.io/homebrew/ubuntu22.04:master
defaults:
run:
shell: bash
env:
HOMEBREW_SIMULATE_MACOS_ON_LINUX: 1
BOTTLES_DIR: ${{ github.workspace }}/bottles
steps:
- name: ${{github.event.inputs.formula}}
id: print_details
run: |
echo sender=${{github.event.sender.login}}
echo formula=${{github.event.inputs.formula}}
echo issue=${{github.event.inputs.issue}}
echo upload=${{github.event.inputs.upload}}
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
core: true
cask: false
test-bot: false
- name: Download bottles from GitHub Actions
uses: actions/download-artifact@v4
with:
pattern: bottles_*
path: ${{ env.BOTTLES_DIR }}
merge-multiple: true
- name: Configure Git user
id: git-user-config
uses: Homebrew/actions/git-user-config@master
with:
username: BrewTestBot
- name: Upload bottles to GitHub Packages
env:
HOMEBREW_GITHUB_PACKAGES_USER: ${{ github.repository_owner }}
HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
working-directory: ${{ env.BOTTLES_DIR }}
run: |
brew pr-upload --verbose --root-url="https://ghcr.io/v2/${{ github.repository_owner }}/extensions"
- name: Push commits
uses: Homebrew/actions/git-try-push@master
with:
directory: ${{steps.set-up-homebrew.outputs.repository-path}}
token: ${{secrets.GITHUB_TOKEN}}