-
Notifications
You must be signed in to change notification settings - Fork 548
154 lines (136 loc) · 5.67 KB
/
binaries.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
145
146
147
148
149
150
151
152
153
154
name: Passenger generic binaries tests CI tests
env:
ENTERPRISE: 0
on:
push: {}
pull_request: {}
jobs:
# build_linux:
# name: "Binary automation Linux-${{ matrix.arch }}"
# strategy:
# fail-fast: false
# matrix:
# include:
# - arch: x86_64
# runner: ubuntu-24.04
# - arch: aarch64
# runner: passenger-ubuntu-24.04-arm64-4cpu
# runs-on: ${{ matrix.runner }}
# env:
# WORKSPACE: ${{ github.workspace }}
# OUTPUT_DIR: ${{ github.workspace }}/output-linux-${{ matrix.arch }}
# ARCHITECTURE: ${{ matrix.arch }}
# CACHE_DIR: ${{ github.workspace }}/cache/linux-${{ matrix.arch }}/executor-${{ github.run_id }}
# RUNTIME_DIR: ${{ github.workspace }}/cache/linux-${{ matrix.arch }}/executor-${{ github.run_id }}/runtime
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - uses: docker/setup-buildx-action@v3
# - run: ./dev/ci/tests/binaries/build-linux
# - uses: actions/upload-artifact@v4
# with:
# name: binaries-linux-${{ matrix.arch }}
# path: 'output-linux-${{ matrix.arch }}/**/*'
# - run: ./dev/ci/tests/binaries/test-linux
build_macos:
name: Binaries macOS ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
include:
- runner: macos-13
arch: x86_64
- runner: macos-14
arch: arm64
runs-on: ${{ matrix.runner }}
environment: dev
permissions:
id-token: write
env:
WORKSPACE: ${{ github.workspace }}
OUTPUT_DIR: ${{ github.workspace }}/output
ARCHITECTURE: ${{ matrix.arch }}
CACHE_DIR: ${{ github.workspace }}/cache/macos-${{ matrix.arch }}/executor-${{ github.run_id }}
RUNTIME_DIR: ${{ github.workspace }}/cache/macos-${{ matrix.arch }}/executor-${{ github.run_id }}/runtime
steps:
- uses: actions/checkout@v4
with:
submodules: true
# - uses: azure/login@v2
# with:
# tenant-id: ${{ vars.AZURE_TENANT_ID }}
# client-id: ${{ vars.AZURE_CLIENT_ID }}
# subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
- name: Install RVM
run: set -o pipefail && curl -fsSL https://get.rvm.io | bash
- name: Install Rubies
run: xargs -I{} "$HOME/.rvm/bin/rvm" install ruby-{} < packaging/binaries/shared/definitions/ruby_versions
- run: mkdir cache runtime
working-directory: packaging/binaries
- name: Determine runtime version
id: determine_runtime_version
run: |
RUNTIME_VERSION=$(cat shared/definitions/macos_runtime_version)
echo "version=$RUNTIME_VERSION" >> "$GITHUB_OUTPUT"
working-directory: packaging/binaries
- name: Check whether precompiled runtime exists
id: check_precompiled_runtime_exists
run: |
OUTPUT=$(
az storage blob exists \
-c "$AZURE_CI_STORAGE_CONTAINER_NAME" \
-n "macos-runtime-$SUFFIX.tar.zstd" \
-o tsv
)
echo "exists=$OUTPUT" >> "$GITHUB_OUTPUT"
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
AZURE_CI_STORAGE_CONTAINER_NAME: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
SUFFIX: ${{ steps.determine_runtime_version.outputs.version }}-${{ matrix.runner }}-${{ matrix.arch }}
- name: Download precompiled runtime
run: >
az storage blob download
-c "$AZURE_CI_STORAGE_CONTAINER_NAME"
-n "macos-runtime-$SUFFIX.tar.zstd"
-f macos-runtime.tar.zstd
--no-progress
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
AZURE_CI_STORAGE_CONTAINER_NAME: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
SUFFIX: ${{ steps.determine_runtime_version.outputs.version }}-${{ matrix.runner }}-${{ matrix.arch }}
if: steps.check_precompiled_runtime_exists.outputs.exists == 'True'
working-directory: packaging/binaries
- name: Extract precompiled runtime
run: tar -C runtime -x --zstd -f macos-runtime.tar.zstd && rm macos-runtime.tar.zstd
if: steps.check_precompiled_runtime_exists.outputs.exists == 'True'
working-directory: packaging/binaries
- name: Compile runtime
run: ./macos/setup-runtime -c cache -o runtime -j 4
if: steps.check_precompiled_runtime_exists.outputs.exists != 'True'
working-directory: packaging/binaries
- name: Package compiled runtime
run: tar -C runtime -c --zstd -f macos-runtime.tar.zstd .
if: steps.check_precompiled_runtime_exists.outputs.exists != 'True'
working-directory: packaging/binaries
- name: Store compiled runtime
run: >
az storage blob upload
-c "$AZURE_CI_STORAGE_CONTAINER_NAME"
-n "macos-runtime-$SUFFIX.tar.zstd"
-f macos-runtime.tar.zstd
--overwrite
&&
rm macos-runtime.tar.zstd
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
AZURE_CI_STORAGE_CONTAINER_NAME: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
SUFFIX: ${{ steps.determine_runtime_version.outputs.version }}-${{ matrix.runner }}-${{ matrix.arch }}
if: steps.check_precompiled_runtime_exists.outputs.exists != 'True'
working-directory: packaging/binaries
- run: ./dev/ci/tests/binaries/build-macos
- uses: actions/upload-artifact@v4
with:
name: binaries-macos-${{ matrix.arch }}
path: 'output-macos-${{ matrix.arch }}/**/*'
- run: ./dev/ci/tests/binaries/test-macos