diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index e351385..7c7a38b 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -95,3 +95,33 @@ jobs: - name: gem install openssl if: (matrix.ruby >= '2.4') && (matrix.ruby <= '3.2') run: gem install openssl -N + + plus: + name: >- + plus ${{ matrix.os }} ${{ matrix.ruby }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-20.04, macos-11 ] + ruby: [ '3.0' ] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Ruby Install + uses: ./ + with: + ruby-version: ${{ matrix.ruby }} + apt-get: g++ + brew: libxml++3 + + - name: Info + run: | + ruby -v + echo '' + gcc --version + echo '' + bundler version + echo '' + gem --version diff --git a/apt.js b/apt.js index fd46caa..0350e6f 100644 --- a/apt.js +++ b/apt.js @@ -2,16 +2,16 @@ const core = require('@actions/core') -const { execSync, grpSt, grpEnd } = require('./common') +const { execSync, grpSt, grpEnd, getInput } = require('./common') // group start time let msSt -// clean inputs -let apt = core.getInput('apt-get').replace(/[^a-z_ \d.-]+/gi, '').trim().toLowerCase() - export const run = async () => { try { + // clean input + let apt = getInput('apt-get') + if (apt !== '') { // fix for server timeout issues diff --git a/brew.js b/brew.js index 9cd957d..a193fdd 100644 --- a/brew.js +++ b/brew.js @@ -7,11 +7,12 @@ const { execSync, grpSt, grpEnd } = require('./common') // group start time let msSt -// clean inputs -let brew = core.getInput('brew').replace(/[^a-z_ \d.@-]+/gi, '').trim().toLowerCase() - export const run = async () => { try { + // clean input + // use different regex than getInput in common.js. Some packages contain @ character + let brew = core.getInput('brew').replace(/[^a-z_ \d.+@-]+/gi, '').trim().toLowerCase() + if (brew !== '') { let needUpdate = true diff --git a/common.js b/common.js index 7c819f2..d37096c 100644 --- a/common.js +++ b/common.js @@ -97,7 +97,9 @@ export const log = (logText, color = 'yel') => { console.log(`${colors[color]}${logText}${rst}`) } -export const getInput = (name) => core.getInput(name).replace(/[^a-z_ \d.-]+/gi, '').trim().toLowerCase() +// Used by apt, mingw, & mswin for input 'cleaning'. Brew also uses +// @ character in package names, so regex is in brew.js. +export const getInput = (name) => core.getInput(name).replace(/[^a-z_ \d.+-]+/gi, '').trim().toLowerCase() // convert windows path like C:\Users\runneradmin to /c/Users/runneradmin export const win2nix = (path) => { diff --git a/dist/index.js b/dist/index.js index a56377c..3abf448 100644 --- a/dist/index.js +++ b/dist/index.js @@ -13,16 +13,16 @@ __nccwpck_require__.r(__webpack_exports__); const core = __nccwpck_require__(186) -const { execSync, grpSt, grpEnd } = __nccwpck_require__(390) +const { execSync, grpSt, grpEnd, getInput } = __nccwpck_require__(390) // group start time let msSt -// clean inputs -let apt = core.getInput('apt-get').replace(/[^a-z_ \d.-]+/gi, '').trim().toLowerCase() - const run = async () => { try { + // clean input + let apt = getInput('apt-get') + if (apt !== '') { // fix for server timeout issues @@ -94,11 +94,12 @@ const { execSync, grpSt, grpEnd } = __nccwpck_require__(390) // group start time let msSt -// clean inputs -let brew = core.getInput('brew').replace(/[^a-z_ \d.@-]+/gi, '').trim().toLowerCase() - const run = async () => { try { + // clean input + // use different regex than getInput in common.js. Some packages contain @ character + let brew = core.getInput('brew').replace(/[^a-z_ \d.+@-]+/gi, '').trim().toLowerCase() + if (brew !== '') { let needUpdate = true @@ -250,7 +251,9 @@ const log = (logText, color = 'yel') => { console.log(`${colors[color]}${logText}${rst}`) } -const getInput = (name) => core.getInput(name).replace(/[^a-z_ \d.-]+/gi, '').trim().toLowerCase() +// Used by apt, mingw, & mswin for input 'cleaning'. Brew also uses +// @ character in package names, so regex is in brew.js. +const getInput = (name) => core.getInput(name).replace(/[^a-z_ \d.+-]+/gi, '').trim().toLowerCase() // convert windows path like C:\Users\runneradmin to /c/Users/runneradmin const win2nix = (path) => { @@ -1097,6 +1100,13 @@ Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () */ var summary_2 = __nccwpck_require__(327); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); +/** + * Path exports + */ +var path_utils_1 = __nccwpck_require__(981); +Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); +Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); +Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); //# sourceMappingURL=core.js.map /***/ }), @@ -1234,6 +1244,71 @@ exports.OidcClient = OidcClient; /***/ }), +/***/ 981: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; +const path = __importStar(__nccwpck_require__(17)); +/** + * toPosixPath converts the given path to the posix form. On Windows, \\ will be + * replaced with /. + * + * @param pth. Path to transform. + * @return string Posix path. + */ +function toPosixPath(pth) { + return pth.replace(/[\\]/g, '/'); +} +exports.toPosixPath = toPosixPath; +/** + * toWin32Path converts the given path to the win32 form. On Linux, / will be + * replaced with \\. + * + * @param pth. Path to transform. + * @return string Win32 path. + */ +function toWin32Path(pth) { + return pth.replace(/[/]/g, '\\'); +} +exports.toWin32Path = toWin32Path; +/** + * toPlatformPath converts the given path to a platform-specific path. It does + * this by replacing instances of / and \ with the platform-specific path + * separator. + * + * @param pth The path to platformize. + * @return string The platform-specific path. + */ +function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path.sep); +} +exports.toPlatformPath = toPlatformPath; +//# sourceMappingURL=path-utils.js.map + +/***/ }), + /***/ 327: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { diff --git a/dist/package.json b/dist/package.json index 1da1ee1..3d376c2 100644 --- a/dist/package.json +++ b/dist/package.json @@ -1,6 +1,6 @@ { "name": "setup-ruby-pkgs", - "version": "1.32.0", + "version": "1.32.1", "description": "Install packages and update builds tools for Ruby", "main": "index.js", "scripts": { @@ -23,7 +23,7 @@ "author": "MSP-Greg", "license": "MIT", "dependencies": { - "@actions/core": "^1.8.0", + "@actions/core": "^1.9.0", "@actions/http-client": "^2.0.1" }, "devDependencies": { diff --git a/package.json b/package.json index 1da1ee1..3d376c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "setup-ruby-pkgs", - "version": "1.32.0", + "version": "1.32.1", "description": "Install packages and update builds tools for Ruby", "main": "index.js", "scripts": { @@ -23,7 +23,7 @@ "author": "MSP-Greg", "license": "MIT", "dependencies": { - "@actions/core": "^1.8.0", + "@actions/core": "^1.9.0", "@actions/http-client": "^2.0.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 1d5fcc3..9e1d4bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,9 +3,9 @@ "@actions/core@^1.8.0": - version "1.8.2" - resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.8.2.tgz#67539d669ae9b751430469e9ae4d83e0525973ac" - integrity sha512-FXcBL7nyik8K5ODeCKlxi+vts7torOkoDAKfeh61EAkAy1HAvwn9uVzZBY0f15YcQTcZZ2/iSGBFHEuioZWfDA== + version "1.9.0" + resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.9.0.tgz#20c1baac5d4bd2508ba1fc3e5f3fc4b8a80d4082" + integrity sha512-5pbM693Ih59ZdUhgk+fts+bUWTnIdHV3kwOSr+QIoFHMLg7Gzhwm0cifDY/AG68ekEJAkHnQVpcy4f6GjmzBCA== dependencies: "@actions/http-client" "^2.0.1"