diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a32a309..b1a4dc9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -213,5 +213,5 @@ jobs: with: upload_url: ${{ needs.create_release.outputs.upload_url }} asset_path: ./build/Release/node-raylib.node - asset_name: node-raylib-darwin-x64.node - asset_content_type: application/octet-stream \ No newline at end of file + asset_name: node-raylib-darwin.node + asset_content_type: application/octet-stream diff --git a/CMakeLists.txt b/CMakeLists.txt index 47b2969..8dc7338 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,9 @@ endif() set(CMAKE_CXX_FLAGS_DEBUG "-g") +# single build for both Mac arches +set(CMAKE_OSX_ARCHITECTURES arm64 x86_64) + # version doesn't seem to pick correct version #find_package(raylib 5.5 QUIET EXACT) if (NOT raylib_FOUND) diff --git a/tools/postinstall.js b/tools/postinstall.js index 5afcaa6..28b0bb5 100644 --- a/tools/postinstall.js +++ b/tools/postinstall.js @@ -41,7 +41,12 @@ async function main() { let url = `https://github.com/RobLoach/node-raylib/releases/download/v${version}/node-raylib-${process.platform}-${process.arch}.node`; - console.log(`Checking for ${url}`); + // we use a single build for both platforms on Mac + if (process.platform === 'darwin') { + url = `https://github.com/RobLoach/node-raylib/releases/download/v${process.env.npm_package_version}/node-raylib-darwin.node` + } + + console.log(`Checking for ${url}`) try { await fs.mkdir(path.join(__dirname, "..", "build"));