diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 87d4022f0..56e310c47 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,11 +14,9 @@ jobs: node: [20] os: - name: darwin - architecture: arm64 - host: macos-13 + host: macos-14 - name: linux - architecture: x86-64 host: ubuntu-20.04 env: CC: clang diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 357caebcd..3bfe34450 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -46,6 +46,8 @@ jobs: eval "$(ssh-agent -s)" ssh-add ~/.ssh_tests/id_rsa + npm install --ignore-scripts + npm run generate npm install npm test @@ -81,5 +83,7 @@ jobs: eval "$(ssh-agent -s)" ssh-add ~/.ssh_tests/id_rsa + npm install --ignore-scripts + npm run generate npm install npm test diff --git a/.npmignore b/.npmignore index 1a87c3d5f..17cd756ca 100644 --- a/.npmignore +++ b/.npmignore @@ -10,9 +10,6 @@ /src/ /vendor/ -# we do need the libgit2.gyp file though, so node-gyp can run -!/vendor/libgit2.gyp - .astylerc .editorconfig .gitignore diff --git a/lifecycleScripts/preinstall.js b/lifecycleScripts/preinstall.js index 870cf1558..085a5aff5 100755 --- a/lifecycleScripts/preinstall.js +++ b/lifecycleScripts/preinstall.js @@ -1,47 +1,23 @@ var path = require("path"); var local = path.join.bind(path, __dirname); -var exec = require(local("../utils/execPromise")); var buildFlags = require(local("../utils/buildFlags")); module.exports = function prepareForBuild() { - console.log("[nodegit] Running pre-install script"); - - return exec("npm -v") - .then( - function(npmVersion) { - if (npmVersion.split(".")[0] < 3) { - console.log( - "[nodegit] npm@2 installed, pre-loading required packages" - ); - return exec("npm install --ignore-scripts"); - } - - return Promise.resolve(); - }, - function() { - // We're installing via yarn, so don't - // care about compability with npm@2 - } - ) - .then(function() { - if (buildFlags.isGitRepo) { - var submodules = require(local("submodules")); - var generate = require(local("../generate")); - return submodules() - .then(function() { - return generate(); - }); - } + if (buildFlags.isGitRepo) { + var submodules = require(local("submodules")); + var generate = require(local("../generate")); + return submodules().then(function () { + return generate(); }); + } }; // Called on the command line if (require.main === module) { - module.exports() - .catch(function(e) { - console.error("[nodegit] ERROR - Could not finish preinstall"); - console.error(e); - process.exit(1); - }); + module.exports().catch(function (e) { + console.error("[nodegit] ERROR - Could not finish preinstall"); + console.error(e); + process.exit(1); + }); } diff --git a/package.json b/package.json index 0151cee72..c085e2b52 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,8 @@ "generateJson": "node generate/scripts/generateJson", "generateMissingTests": "node generate/scripts/generateMissingTests", "generateNativeCode": "node generate/scripts/generateNativeCode", - "install": "node lifecycleScripts/preinstall.js && node-gyp-build", + "generate": "node lifecycleScripts/preinstall.js", + "install": "node-gyp-build", "installDebug": "BUILD_DEBUG=true npm install", "lint": "jshint lib test/tests test/utils lifecycleScripts", "mergecov": "lcov-result-merger 'test/**/*.info' 'test/coverage/merged.lcov' && ./lcov-1.10/bin/genhtml test/coverage/merged.lcov --output-directory test/coverage/report",