diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 614b730..18d55ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,7 @@ name: CI on: push: - branches: [ master ] pull_request: - branches: [ master ] jobs: build: @@ -12,13 +10,13 @@ jobs: strategy: matrix: - os: + os: - ubuntu-latest - windows-latest - macos-latest steps: - - uses: actions/checkout@v2 - - uses: ./ - - run: lix - - run: lix install haxe stable + - uses: actions/checkout@v2 + - uses: ./ + - run: lix + - run: lix install haxe stable diff --git a/.gitignore b/.gitignore index b3015d3..b512c09 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -node_modules -build/haxe-output.js \ No newline at end of file +node_modules \ No newline at end of file diff --git a/action.yml b/action.yml index 9cce02b..43c06f7 100644 --- a/action.yml +++ b/action.yml @@ -1,13 +1,11 @@ -name: 'Setup Lix' -description: 'Setup Lix (a package manager for Haxe)' +name: "Setup Lix" +description: "Setup Lix (a package manager for Haxe)" branding: - icon: 'package' - color: 'blue' + icon: "package" + color: "blue" inputs: - lix-version: - description: 'Version of Lix to use' - required: true - default: '15.12.0' + lix-version: + description: "Version of Lix to use" runs: - using: 'node20' - main: 'build/index.js' + using: "node20" + main: "build/index.js" diff --git a/build.hxml b/build.hxml deleted file mode 100644 index f0a7924..0000000 --- a/build.hxml +++ /dev/null @@ -1,7 +0,0 @@ --cp src --main Main --js build/haxe-output.js --dce full --lib hxnodejs --D analyzer-optimize ---cmd yarn build \ No newline at end of file diff --git a/build/index.js b/build/index.js index d3cca73..cde0861 100644 --- a/build/index.js +++ b/build/index.js @@ -19,7 +19,13 @@ module.exports = /******/ }; /******/ /******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ var threw = true; +/******/ try { +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete installedModules[moduleId]; +/******/ } /******/ /******/ // Flag the module as loaded /******/ module.l = true; @@ -34,7 +40,7 @@ module.exports = /******/ // the startup function /******/ function startup() { /******/ // Load entry module and return exports -/******/ return __webpack_require__(475); +/******/ return __webpack_require__(676); /******/ }; /******/ /******/ // run startup @@ -1981,29 +1987,6 @@ Object.defineProperty(exports, "toWin32Path", { enumerable: true, get: function Object.defineProperty(exports, "toPlatformPath", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }); //# sourceMappingURL=core.js.map -/***/ }), - -/***/ 475: -/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) { - -// Generated by Haxe 4.0.5 -(function ($global) { "use strict"; -var Main = function() { }; -Main.main = function() { - var core = __webpack_require__(470); - js_node_ChildProcess.execSync("yarn global add lix@" + core.getInput("lix-version")); - var path = StringTools.replace(js_node_ChildProcess.execSync("yarn global bin").toString(),"\n",""); - core.addPath(path); -}; -var StringTools = function() { }; -StringTools.replace = function(s,sub,by) { - return s.split(sub).join(by); -}; -var js_node_ChildProcess = __webpack_require__(129); -Main.main(); -})({}); - - /***/ }), /***/ 498: @@ -2512,6 +2495,19 @@ exports.summary = _summary; module.exports = require("util"); +/***/ }), + +/***/ 676: +/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) { + +const { execSync } = __webpack_require__(129); +const core = __webpack_require__(470); +const version = core.getInput("lix-version"); +execSync("yarn global add lix" + (version ? `@${version}` : "")); +const path = execSync("yarn global bin").toString().replaceAll("\n", ""); +core.addPath(path); + + /***/ }), /***/ 695: diff --git a/haxe_libraries/hxnodejs.hxml b/haxe_libraries/hxnodejs.hxml deleted file mode 100644 index 483b01c..0000000 --- a/haxe_libraries/hxnodejs.hxml +++ /dev/null @@ -1,6 +0,0 @@ --D hxnodejs=10.0.0 -# @install: lix --silent download "haxelib:/hxnodejs#10.0.0" into hxnodejs/10.0.0/haxelib --cp ${HAXE_LIBCACHE}/hxnodejs/10.0.0/haxelib/src ---macro allowPackage('sys') -# should behave like other target defines and not be defined in macro context ---macro define('nodejs') diff --git a/package.json b/package.json index f74375d..182bcd7 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "setup-lix", - "version": "1.0.1", - "license": "MIT", - "scripts": { - "build": "ncc build build/haxe-output.js -o build" - }, - "devDependencies": { - "@actions/core": "^1.9.1", - "@zeit/ncc": "^0.21.1" - } + "name": "setup-lix", + "version": "1.0.1", + "license": "MIT", + "scripts": { + "build": "ncc build src/index.js -o build" + }, + "devDependencies": { + "@actions/core": "^1.9.1", + "@zeit/ncc": "^0.22.3" + } } diff --git a/src/Main.hx b/src/Main.hx deleted file mode 100644 index 158fb12..0000000 --- a/src/Main.hx +++ /dev/null @@ -1,14 +0,0 @@ -import sys.FileSystem; -import js.node.ChildProcess; -import js.node.Buffer; -using StringTools; - -class Main { - static function main() { - var core = js.Lib.require('@actions/core'); - var version = core.getInput('lix-version'); - ChildProcess.execSync('yarn global add lix@$version'); - var path = (ChildProcess.execSync('yarn global bin'):Buffer).toString().replace('\n', ''); - core.addPath(path); - } -} \ No newline at end of file diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..04389ae --- /dev/null +++ b/src/index.js @@ -0,0 +1,6 @@ +const { execSync } = require("child_process"); +const core = require("@actions/core"); +const version = core.getInput("lix-version"); +execSync("yarn global add lix" + (version ? `@${version}` : "")); +const path = execSync("yarn global bin").toString().replaceAll("\n", ""); +core.addPath(path); diff --git a/yarn.lock b/yarn.lock index 26929a2..044fced 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,10 +17,10 @@ dependencies: tunnel "^0.0.6" -"@zeit/ncc@^0.21.1": - version "0.21.1" - resolved "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.21.1.tgz" - integrity sha512-M9WzgquSOt2nsjRkYM9LRylBLmmlwNCwYbm3Up3PDEshfvdmIfqpFNSK8EJvR18NwZjGHE5z2avlDtYQx2JQnw== +"@zeit/ncc@^0.22.3": + version "0.22.3" + resolved "https://registry.yarnpkg.com/@zeit/ncc/-/ncc-0.22.3.tgz#fca6b86b4454ce7a7e1e7e755165ec06457f16cd" + integrity sha512-jnCLpLXWuw/PAiJiVbLjA8WBC0IJQbFeUwF4I9M+23MvIxTxk5pD4Q8byQBSPmHQjz5aBoA7AKAElQxMpjrCLQ== tunnel@^0.0.6: version "0.0.6"