Skip to content

Commit dad236e

Browse files
authored
ci(release): macOS x86_64 packages on self-hosted c2pool-mac-intel (#323)
* ci(release): build macOS x86_64 packages on self-hosted c2pool-mac-intel Repoint the release matrix's macOS x86_64 cell from GitHub-hosted macos-13 to the self-hosted Intel runner (macpro-intel-204), mirroring build.yml. Port the launchd Homebrew-PATH guard (#100) so brew resolves under the launchd service PATH. arm64 stays on macos-14. Revert: restore 'runner: macos-13' and drop the Set up Homebrew PATH step. * ci(release): fix macOS universal lipo merge to resolve nested per-arch artifact dirs download-artifact unpacks each per-arch package one level deep (arm64/<pkgdir>/c2pool-<coin>); lipo referenced arm64/c2pool-<coin> directly and failed with 'No such file or directory'. Resolve ARM_SRC and X86_SRC to the staged package dirs so the merge finds both inputs.
1 parent 370e616 commit dad236e

1 file changed

Lines changed: 26 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ jobs:
178178
- arch: arm64
179179
runner: macos-14
180180
- arch: x86_64
181-
runner: macos-13
181+
runner: [self-hosted, macOS, X64, c2pool-mac-intel]
182182
steps:
183183
- uses: actions/checkout@v6
184184

@@ -201,6 +201,21 @@ jobs:
201201
echo "::warning::c2pool-${{ matrix.coin }} source not on this ref — no ${{ matrix.coin }} macOS ${{ matrix.arch }} package will be produced."
202202
fi
203203
204+
- name: Set up Homebrew PATH
205+
# Self-hosted Intel runner (macpro-intel-204) launches Actions from
206+
# launchd, whose PATH omits Homebrew's /usr/local/bin (#100: brew exit
207+
# 127). GitHub-hosted arm64 keeps /opt/homebrew on PATH. Append whichever
208+
# prefix actually has brew so later steps inherit it via $GITHUB_PATH.
209+
run: |
210+
if [ -x /opt/homebrew/bin/brew ]; then
211+
echo "/opt/homebrew/bin" >> "$GITHUB_PATH"
212+
elif [ -x /usr/local/bin/brew ]; then
213+
echo "/usr/local/bin" >> "$GITHUB_PATH"
214+
else
215+
echo "::error::Homebrew not found at /opt/homebrew or /usr/local on ${RUNNER_NAME:-runner}" >&2
216+
exit 1
217+
fi
218+
204219
- name: Install dependencies
205220
if: steps.presence.outputs.exists == '1'
206221
run: brew install cmake boost leveldb secp256k1 nlohmann-json yaml-cpp
@@ -313,17 +328,22 @@ jobs:
313328
VERSION="${{ steps.ver.outputs.version }}"
314329
COIN="${{ matrix.coin }}"
315330
PKG="c2pool-${COIN}-${VERSION}-macos-universal"
331+
# The per-arch upload preserved its staged top-level dir, so each
332+
# download-artifact unpacks ONE level deep: arm64/<pkgdir>/c2pool-<coin>
333+
# (not arm64/c2pool-<coin>). Resolve that nested tree per arch.
334+
ARM_SRC="arm64/c2pool-${COIN}-${VERSION}-macos-arm64"
335+
X86_SRC="x86_64/c2pool-${COIN}-${VERSION}-macos-x86_64"
316336
# config/web-static/explorer/start.sh are arch-independent; seed the
317337
# universal package from the arm64 tree, then overwrite the binary
318338
# and every dylib with their lipo-merged universal counterparts.
319-
cp -R arm64 "${PKG}"
339+
cp -R "${ARM_SRC}" "${PKG}"
320340
rm -f "${PKG}/c2pool-${COIN}"
321-
lipo -create "arm64/c2pool-${COIN}" "x86_64/c2pool-${COIN}" -output "${PKG}/c2pool-${COIN}"
341+
lipo -create "${ARM_SRC}/c2pool-${COIN}" "${X86_SRC}/c2pool-${COIN}" -output "${PKG}/c2pool-${COIN}"
322342
chmod +x "${PKG}/c2pool-${COIN}"
323-
for lib in arm64/lib/*.dylib; do
343+
for lib in "${ARM_SRC}"/lib/*.dylib; do
324344
base=$(basename "$lib")
325-
if [ -f "x86_64/lib/${base}" ]; then
326-
lipo -create "$lib" "x86_64/lib/${base}" -output "${PKG}/lib/${base}"
345+
if [ -f "${X86_SRC}/lib/${base}" ]; then
346+
lipo -create "$lib" "${X86_SRC}/lib/${base}" -output "${PKG}/lib/${base}"
327347
else
328348
cp "$lib" "${PKG}/lib/${base}"
329349
fi

0 commit comments

Comments
 (0)