This commit is contained in:
Opportunity
2019-09-30 18:16:56 +08:00
Unverified
parent 7c2a9b6f1c
commit 74d9ac9b05
3 changed files with 17 additions and 9 deletions
+6 -1
View File
@@ -1,11 +1,16 @@
const core = require('@actions/core') const core = require('@actions/core')
const { exec, execSync } = require('child_process') const { exec, execSync } = require('child_process')
const fetch = require('node-fetch')
const fs = require('fs')
async function run() { async function run() {
try { try {
const version = core.getInput('xmake-version') const version = core.getInput('xmake-version')
execSync("bash <(curl -fsSL https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.sh)") const data = fetch('https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.sh')
await fs.promises.mkdir('/tmp/xmake')
await fs.promises.writeFile(`/tmp/xmake/get.sh`, await (await data).buffer())
execSync(`bash /tmp/xmake/get.sh`)
core.addPath("/home/runner/.local/bin") core.addPath("/home/runner/.local/bin")
} catch (error) { } catch (error) {
+9 -7
View File
@@ -1,27 +1,29 @@
{ {
"_from": "node-fetch@^2.3.0", "_from": "node-fetch",
"_id": "node-fetch@2.6.0", "_id": "node-fetch@2.6.0",
"_inBundle": false, "_inBundle": false,
"_integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", "_integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==",
"_location": "/node-fetch", "_location": "/node-fetch",
"_phantomChildren": {}, "_phantomChildren": {},
"_requested": { "_requested": {
"type": "range", "type": "tag",
"registry": true, "registry": true,
"raw": "node-fetch@^2.3.0", "raw": "node-fetch",
"name": "node-fetch", "name": "node-fetch",
"escapedName": "node-fetch", "escapedName": "node-fetch",
"rawSpec": "^2.3.0", "rawSpec": "",
"saveSpec": null, "saveSpec": null,
"fetchSpec": "^2.3.0" "fetchSpec": "latest"
}, },
"_requiredBy": [ "_requiredBy": [
"#USER",
"/",
"/@octokit/request" "/@octokit/request"
], ],
"_resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", "_resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
"_shasum": "e633456386d4aa55863f676a7ab0daa8fdecb0fd", "_shasum": "e633456386d4aa55863f676a7ab0daa8fdecb0fd",
"_spec": "node-fetch@^2.3.0", "_spec": "node-fetch",
"_where": "C:\\Users\\lzy\\Documents\\Source\\OpportunityLiu\\github-action-setup-xmake\\node_modules\\@octokit\\request", "_where": "C:\\Users\\lzy\\Documents\\Source\\OpportunityLiu\\github-action-setup-xmake",
"author": { "author": {
"name": "David Frank" "name": "David Frank"
}, },
+2 -1
View File
@@ -10,6 +10,7 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@actions/core": "^1.1.1", "@actions/core": "^1.1.1",
"@actions/github": "^1.1.0" "@actions/github": "^1.1.0",
"node-fetch": "^2.6.0"
} }
} }