From 50cf258fbc10adaf57a8a09a5590cb74681f5985 Mon Sep 17 00:00:00 2001 From: bexnoss <82064510+bexnoss@users.noreply.github.com> Date: Wed, 23 Feb 2022 09:53:44 +0100 Subject: [PATCH] Add "build-npm" script This script can be used to build @actions/setup-python when it was installed as a dependency in another action. Add dependency: `npm install actions/setup-python#v2` Automatically build on install: ``` "scripts": { "postinstall": "npm run build-npm --prefix node_modules/setup-python" } ``` Install depending action as usual: `npm ci` or `npm install` No further steps necessary, @actions/setup-python is built automatically in the "postinstall" step of installation. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 7af319cc..ddfcdfa5 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "main": "dist/index.js", "scripts": { "build": "ncc build -o dist/setup src/setup-python.ts && ncc build -o dist/cache-save src/cache-save.ts", + "build-npm": "npm ci && node -e \"try{require('fs').rmdirSync('lib',{recursive:true})}catch(e){}\" && tsc --declaration --declarationMap", "format": "prettier --write \"{,!(node_modules)/**/}*.ts\"", "format-check": "prettier --check \"{,!(node_modules)/**/}*.ts\"", "release": "ncc build -o dist/setup src/setup-python.ts && ncc build -o dist/cache-save src/cache-save.ts && git add -f dist/",