Bump version to 2.14.0

Add config to generate types

Fix build error in install.ts after TypeScript upgrade

Minor refactor in install.test.ts

Add bugs, directories, files and types entries in package.json

Update Node.js dependencies

Update SECURITY.md
This commit is contained in:
Shivam Mathur 2021-09-10 03:08:04 +05:30
parent 35bc046b26
commit a34eeedd37
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
7 changed files with 790 additions and 753 deletions

3
.github/SECURITY.md vendored
View File

@ -7,7 +7,7 @@ The following versions of this project are supported for security updates.
| Version | Supported | | Version | Supported |
| ------- | ------------------ | | ------- | ------------------ |
| 1.11.x | :white_check_mark: | | 1.11.x | :white_check_mark: |
| 2.11.x | :white_check_mark: | | 2.14.x | :white_check_mark: |
## Supported PHP Versions ## Supported PHP Versions
@ -18,6 +18,7 @@ This security policy only applies to the latest patches of the following PHP ver
| 7.3 | :white_check_mark: | | 7.3 | :white_check_mark: |
| 7.4 | :white_check_mark: | | 7.4 | :white_check_mark: |
| 8.0 | :white_check_mark: | | 8.0 | :white_check_mark: |
| 8.1 | :white_check_mark: |
## Reporting a Vulnerability ## Reporting a Vulnerability

View File

@ -17,25 +17,11 @@ jest.mock('../src/install', () => ({
const ini_values_csv: string = process.env['ini-values'] || ''; const ini_values_csv: string = process.env['ini-values'] || '';
const coverage_driver: string = process.env['coverage'] || ''; const coverage_driver: string = process.env['coverage'] || '';
let tools_csv: string = process.env['tools'] || ''; let tools_csv: string = process.env['tools'] || '';
const pecl: string = process.env['pecl'] || '';
if (pecl == 'true') {
tools_csv = 'pecl, ' + tools_csv;
}
let script = 'initial script ' + filename + version + os_version; let script = 'initial script ' + filename + version + os_version;
if (tools_csv) { script += tools_csv ? 'add_tool' : '';
script += 'add_tool'; script += extension_csv ? 'install extensions' : '';
} script += coverage_driver ? 'set coverage driver' : '';
if (extension_csv) { script += ini_values_csv ? 'edit php.ini' : '';
script += 'install extensions';
}
if (coverage_driver) {
script += 'set coverage driver';
}
if (ini_values_csv) {
script += 'edit php.ini';
}
return script; return script;
} }
), ),

9
dist/index.js vendored
View File

@ -424,8 +424,7 @@ const extensions = __importStar(__nccwpck_require__(390));
const tools = __importStar(__nccwpck_require__(740)); const tools = __importStar(__nccwpck_require__(740));
const utils = __importStar(__nccwpck_require__(918)); const utils = __importStar(__nccwpck_require__(918));
async function getScript(filename, version, os_version) { async function getScript(filename, version, os_version) {
const name = 'setup-php'; const url = 'https://setup-php.com/sponsor';
const url = 'https://setup-php.com/support';
process.env['fail_fast'] = await utils.getInput('fail-fast', false); process.env['fail_fast'] = await utils.getInput('fail-fast', false);
const extension_csv = await utils.getInput('extensions', false); const extension_csv = await utils.getInput('extensions', false);
const ini_values_csv = await utils.getInput('ini-values', false); const ini_values_csv = await utils.getInput('ini-values', false);
@ -442,8 +441,8 @@ async function getScript(filename, version, os_version) {
if (ini_values_csv) { if (ini_values_csv) {
script += await config.addINIValues(ini_values_csv, os_version); script += await config.addINIValues(ini_values_csv, os_version);
} }
script += '\n' + (await utils.stepLog('Support this project', os_version)); script += '\n' + (await utils.stepLog(`Sponsor setup-php`, os_version));
script += '\n' + (await utils.addLog('$tick', name, url, os_version)); script += '\n' + (await utils.addLog('$tick', 'setup-php', url, os_version));
return await utils.writeScript(filename, script); return await utils.writeScript(filename, script);
} }
exports.getScript = getScript; exports.getScript = getScript;
@ -459,7 +458,7 @@ async function run() {
const tool = await utils.scriptTool(os_version); const tool = await utils.scriptTool(os_version);
const script = os_version + (await utils.scriptExtension(os_version)); const script = os_version + (await utils.scriptExtension(os_version));
const location = await getScript(script, version, os_version); const location = await getScript(script, version, os_version);
await exec_1.exec(await utils.joins(tool, location, version, __dirname)); await (0, exec_1.exec)(await utils.joins(tool, location, version, __dirname));
} }
else { else {
core.setFailed('Unable to get the PHP version'); core.setFailed('Unable to get the PHP version');

1456
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,24 @@
{ {
"name": "setup-php", "name": "setup-php",
"version": "2.13.0", "version": "2.14.0",
"private": false, "private": false,
"description": "Setup PHP for use with GitHub Actions", "description": "Setup PHP for use with GitHub Actions",
"main": "lib/install.js", "main": "lib/install.js",
"types": "lib/install.d.ts",
"directories": {
"lib": "lib",
"test": "__tests__",
"src": "src"
},
"files": [
"lib",
"src"
],
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"lint": "eslint **/*.ts --cache --fix", "lint": "eslint **/src/*.ts --cache --fix",
"format": "prettier --write **/*.ts && git add .", "format": "prettier --write **/src/*.ts && git add .",
"format-check": "prettier --check **/*.ts", "format-check": "prettier --check **/src/*.ts",
"release": "ncc build -o dist && git add -f dist/", "release": "ncc build -o dist && git add -f dist/",
"test": "jest" "test": "jest"
}, },
@ -31,21 +41,24 @@
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^27.0.1", "@types/jest": "^27.0.1",
"@types/node": "^16.7.1", "@types/node": "^16.9.1",
"@typescript-eslint/eslint-plugin": "^4.29.2", "@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.29.2", "@typescript-eslint/parser": "^4.31.0",
"@vercel/ncc": "^0.29.2", "@vercel/ncc": "^0.31.0",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.1", "eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^24.4.0", "eslint-plugin-jest": "^24.4.0",
"eslint-plugin-prettier": "^3.4.1", "eslint-plugin-prettier": "^4.0.0",
"husky": "^4.3.8", "husky": "^4.3.8",
"jest": "^27.0.6", "jest": "^27.1.1",
"jest-circus": "^27.0.6", "jest-circus": "^27.1.1",
"prettier": "^2.3.2", "prettier": "^2.4.0",
"ts-jest": "^27.0.5", "ts-jest": "^27.0.5",
"typescript": "^4.3.5" "typescript": "^4.4.3"
},
"bugs": {
"url": "https://github.com/shivammathur/setup-php/issues"
}, },
"husky": { "husky": {
"skipCI": true, "skipCI": true,

View File

@ -18,8 +18,7 @@ export async function getScript(
version: string, version: string,
os_version: string os_version: string
): Promise<string> { ): Promise<string> {
const name = 'setup-php'; const url = 'https://setup-php.com/sponsor';
const url = 'https://setup-php.com/support';
// taking inputs // taking inputs
process.env['fail_fast'] = await utils.getInput('fail-fast', false); process.env['fail_fast'] = await utils.getInput('fail-fast', false);
const extension_csv: string = await utils.getInput('extensions', false); const extension_csv: string = await utils.getInput('extensions', false);
@ -29,7 +28,6 @@ export async function getScript(
let script: string = await utils.readFile(filename, 'src/scripts'); let script: string = await utils.readFile(filename, 'src/scripts');
script += await tools.addTools(tools_csv, version, os_version); script += await tools.addTools(tools_csv, version, os_version);
if (extension_csv) { if (extension_csv) {
script += await extensions.addExtension(extension_csv, version, os_version); script += await extensions.addExtension(extension_csv, version, os_version);
} }
@ -39,9 +37,8 @@ export async function getScript(
if (ini_values_csv) { if (ini_values_csv) {
script += await config.addINIValues(ini_values_csv, os_version); script += await config.addINIValues(ini_values_csv, os_version);
} }
script += '\n' + (await utils.stepLog(`Sponsor setup-php`, os_version));
script += '\n' + (await utils.stepLog('Support this project', os_version)); script += '\n' + (await utils.addLog('$tick', 'setup-php', url, os_version));
script += '\n' + (await utils.addLog('$tick', name, url, os_version));
return await utils.writeScript(filename, script); return await utils.writeScript(filename, script);
} }
@ -70,7 +67,7 @@ export async function run(): Promise<void> {
core.setFailed('Unable to get the PHP version'); core.setFailed('Unable to get the PHP version');
} }
} catch (error) { } catch (error) {
core.setFailed(error.message); core.setFailed((error as Error).message);
} }
} }

View File

@ -1,5 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"declaration": true,
"esModuleInterop": true, "esModuleInterop": true,
"lib": [ "lib": [
"ES2020" "ES2020"