-
-
Notifications
You must be signed in to change notification settings - Fork 43
62 lines (52 loc) · 1.8 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
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
fail-fast: false
runs-on: ${{matrix.os}}
container: ${{matrix.container && fromJSON(matrix.container) || ''}}
defaults:
run:
working-directory: ${{matrix.workdir || github.workspace}}
steps:
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- run: brew test-bot --only-cleanup-before
- run: brew test-bot --only-setup
- name: Build Portable Ruby
run: |
mkdir -p bottle/
cd bottle
brew portable-package --verbose portable-ruby
- name: Upload Portable Ruby
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.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