Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ jobs:
- arch: arm64
runner: macos-14
- arch: x86_64
runner: macos-13
runner: [self-hosted, macOS, X64, c2pool-mac-intel]
steps:
- uses: actions/checkout@v6

Expand All @@ -201,6 +201,21 @@ jobs:
echo "::warning::c2pool-${{ matrix.coin }} source not on this ref — no ${{ matrix.coin }} macOS ${{ matrix.arch }} package will be produced."
fi

- name: Set up Homebrew PATH
# Self-hosted Intel runner (macpro-intel-204) launches Actions from
# launchd, whose PATH omits Homebrew's /usr/local/bin (#100: brew exit
# 127). GitHub-hosted arm64 keeps /opt/homebrew on PATH. Append whichever
# prefix actually has brew so later steps inherit it via $GITHUB_PATH.
run: |
if [ -x /opt/homebrew/bin/brew ]; then
echo "/opt/homebrew/bin" >> "$GITHUB_PATH"
elif [ -x /usr/local/bin/brew ]; then
echo "/usr/local/bin" >> "$GITHUB_PATH"
else
echo "::error::Homebrew not found at /opt/homebrew or /usr/local on ${RUNNER_NAME:-runner}" >&2
exit 1
fi

- name: Install dependencies
if: steps.presence.outputs.exists == '1'
run: brew install cmake boost leveldb secp256k1 nlohmann-json yaml-cpp
Expand Down Expand Up @@ -313,17 +328,22 @@ jobs:
VERSION="${{ steps.ver.outputs.version }}"
COIN="${{ matrix.coin }}"
PKG="c2pool-${COIN}-${VERSION}-macos-universal"
# The per-arch upload preserved its staged top-level dir, so each
# download-artifact unpacks ONE level deep: arm64/<pkgdir>/c2pool-<coin>
# (not arm64/c2pool-<coin>). Resolve that nested tree per arch.
ARM_SRC="arm64/c2pool-${COIN}-${VERSION}-macos-arm64"
X86_SRC="x86_64/c2pool-${COIN}-${VERSION}-macos-x86_64"
# config/web-static/explorer/start.sh are arch-independent; seed the
# universal package from the arm64 tree, then overwrite the binary
# and every dylib with their lipo-merged universal counterparts.
cp -R arm64 "${PKG}"
cp -R "${ARM_SRC}" "${PKG}"
rm -f "${PKG}/c2pool-${COIN}"
lipo -create "arm64/c2pool-${COIN}" "x86_64/c2pool-${COIN}" -output "${PKG}/c2pool-${COIN}"
lipo -create "${ARM_SRC}/c2pool-${COIN}" "${X86_SRC}/c2pool-${COIN}" -output "${PKG}/c2pool-${COIN}"
chmod +x "${PKG}/c2pool-${COIN}"
for lib in arm64/lib/*.dylib; do
for lib in "${ARM_SRC}"/lib/*.dylib; do
base=$(basename "$lib")
if [ -f "x86_64/lib/${base}" ]; then
lipo -create "$lib" "x86_64/lib/${base}" -output "${PKG}/lib/${base}"
if [ -f "${X86_SRC}/lib/${base}" ]; then
lipo -create "$lib" "${X86_SRC}/lib/${base}" -output "${PKG}/lib/${base}"
else
cp "$lib" "${PKG}/lib/${base}"
fi
Expand Down
Loading