-
-
Notifications
You must be signed in to change notification settings - Fork 44
76 lines (65 loc) · 2.39 KB
/
build.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
name: Build
on:
workflow_call:
permissions:
contents: read
env:
HOMEBREW_DEVELOPER: 1
HOMEBREW_NO_AUTO_UPDATE: 1
jobs:
build:
strategy:
matrix:
include:
- os: 10.11-cross-${{github.run_id}}
- os: 11-arm64-cross-${{github.run_id}}
- os: ubuntu-latest
container: '{"image": "ghcr.io/homebrew/ubuntu22.04:master", "options": "--user=linuxbrew"}'
workdir: /github/home
- os: ubuntu-22.04-arm
container: '{"image": "rubylang/ruby:3.3.7-jammy"}'
bootstrap: true
fail-fast: false
runs-on: ${{matrix.os}}
container: ${{matrix.container && fromJSON(matrix.container) || ''}}
defaults:
run:
working-directory: ${{matrix.workdir || github.workspace}}
steps:
- name: Bootstrap
if: matrix.bootstrap
run: |
apt-get update
apt-get install -y --no-install-recommends curl git g++ make gawk patch
mkdir -p /home/linuxbrew/.linuxbrew/bin
git clone https://github.com/Homebrew/brew /home/linuxbrew/.linuxbrew/Homebrew
ln -s ../Homebrew/bin/brew /home/linuxbrew/.linuxbrew/bin/brew
echo "/home/linuxbrew/.linuxbrew/bin" >>"${GITHUB_PATH}"
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- run: brew test-bot --only-cleanup-before
- run: brew test-bot --only-setup
if: ${{!matrix.bootstrap}}
- name: Build Portable Ruby
run: |
mkdir -p bottle/
cd bottle
brew portable-package --verbose portable-ruby
- name: Upload Portable Ruby
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: bottles_${{matrix.os}}
path: ${{matrix.workdir || github.workspace}}/bottle
- name: Test Portable Ruby
run: |
mkdir -p portable-ruby/
tar --strip-components 2 -C portable-ruby -xf bottle/portable-ruby--*.tar.gz
export PATH="${PWD}/portable-ruby/bin:${PATH}"
export HOMEBREW_USE_RUBY_FROM_PATH=1
rm -rf "$(brew --repo)/Library/Homebrew/vendor/portable-ruby"
brew config | awk -v s="${PWD}/portable-ruby/bin/ruby" '$0~s{r=1} 1; END{exit(!r)}'
- name: Post cleanup
if: always()
run: |
brew test-bot --only-cleanup-after
rm -rvf bottle portable-ruby