mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 17:20:35 +08:00
Chore: play with google/wireit
This commit is contained in:
parent
980cf95c43
commit
f3e000acd3
10
.github/workflows/main.yml
vendored
10
.github/workflows/main.yml
vendored
@ -24,14 +24,8 @@ jobs:
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm i --production
|
||||
- run: node ./Build/build-anti-bogus-domain.js
|
||||
- run: node ./Build/build-apple-cdn.js
|
||||
- run: node ./Build/build-cidr.js
|
||||
- run: node ./Build/build-reject-domainset.js
|
||||
- run: node ./Build/build-telegram-cidr.js
|
||||
- run: node ./Build/build-index.html.js
|
||||
- run: node Build/build-cdn-conf.js
|
||||
- run: npm i
|
||||
- run: npm run build
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
.wireit
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
const https = require('https');
|
||||
|
||||
exports.simpleGet = {
|
||||
https(hostname, path) {
|
||||
const requestOpt = hostname instanceof URL ? hostname : {
|
||||
hostname,
|
||||
path,
|
||||
method: 'GET',
|
||||
};
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const req = https.request(
|
||||
requestOpt,
|
||||
(res) => {
|
||||
const body = [];
|
||||
res.on('data', (chunk) => {
|
||||
body.push(chunk);
|
||||
});
|
||||
res.on('end', () => {
|
||||
try {
|
||||
resolve(String(Buffer.concat(body)));
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
req.on('error', (err) => {
|
||||
reject(err);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
req.end();
|
||||
});
|
||||
}
|
||||
}
|
||||
1728
package-lock.json
generated
1728
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
49
package.json
49
package.json
@ -3,9 +3,51 @@
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"build": "wireit",
|
||||
"build:anti-bogus-domain": "wireit",
|
||||
"build:apple-cdn": "wireit",
|
||||
"build:cdn-conf": "wireit",
|
||||
"build:index-html": "wireit",
|
||||
"build:reject-domainset": "wireit",
|
||||
"build:telegram-cidr": "wireit"
|
||||
},
|
||||
"wireit": {
|
||||
"build:anti-bogus-domain": {
|
||||
"command": "node ./Build/build-anti-bogus-domain.js"
|
||||
},
|
||||
"build:apple-cdn": {
|
||||
"command": "node ./Build/build-apple-cdn.js"
|
||||
},
|
||||
"build:cdn-conf": {
|
||||
"command": "node ./Build/build-cdn-conf.js"
|
||||
},
|
||||
"build:reject-domainset": {
|
||||
"command": "node ./Build/build-reject-domainset.js"
|
||||
},
|
||||
"build:telegram-cidr": {
|
||||
"command": "node ./Build/build-telegram-cidr.js"
|
||||
},
|
||||
"build:index-html": {
|
||||
"command": "node ./Build/build-index.html.js",
|
||||
"dependencies": [
|
||||
"build:anti-bogus-domain",
|
||||
"build:apple-cdn",
|
||||
"build:cdn-conf",
|
||||
"build:reject-domainset",
|
||||
"build:telegram-cidr"
|
||||
]
|
||||
},
|
||||
"build": {
|
||||
"dependencies": [
|
||||
"build:anti-bogus-domain",
|
||||
"build:apple-cdn",
|
||||
"build:cdn-conf",
|
||||
"build:reject-domainset",
|
||||
"build:telegram-cidr",
|
||||
"build:index-html"
|
||||
]
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -19,5 +61,8 @@
|
||||
"piscina": "^3.1.0",
|
||||
"table": "^6.7.3",
|
||||
"undici": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"wireit": "^0.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user