Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix publishing workflow #3443

Merged
merged 4 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/setup-node@v3
with:
cache: yarn
node-version: 20
node-version-file: '.tool-versions'
registry-url: https://registry.npmjs.org

- name: Bootstrap
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/setup-node@v3
with:
cache: yarn
node-version: 20
node-version-file: '.tool-versions'
registry-url: https://registry.npmjs.org

- name: Bootstrap
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ bench/dataset/requests.json
bench/.bench.json

.changelog/
.yarn/
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 20.5.0
chrmod marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
"chalk": "^5.3.0",
"lerna": "^7.3.0",
"prettier": "^3.0.3",
"tslint-no-unused-expression-chai": "^0.1.4"
"tslint-no-unused-expression-chai": "^0.1.4",
"typescript": "^5.2.2"
},
"auto": {
"extends": "@remusao/auto-config",
Expand Down
23 changes: 14 additions & 9 deletions packages/adblocker/assets/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@ const path = require('path');
const adb = require('@cliqz/adblocker');

(async () => {
const { got } = await import("got");
const { revisions } = await fetch('https://cdn.cliqz.com/adblocker/resources/ublock-resources/metadata.json').then(result => {
if (!result.ok) {
throw new Error(`Failed to uBO resources metadata: ${result.status}: ${result.statusText}`);
}
return result.json();
});
const uBOResources = await fetch(`https://cdn.cliqz.com/adblocker/resources/ublock-resources/${revisions.pop()}/list.txt`).then(result => {
if (!result.ok) {
throw new Error(`Failed to uBO resources: ${result.status}: ${result.statusText}`);
}
return result.text();
})

// Update resources.txt
fs.writeFileSync(
path.join(__dirname, 'ublock-origin', 'resources.txt'),
await got(
`https://cdn.cliqz.com/adblocker/resources/ublock-resources/${(
await got(
'https://cdn.cliqz.com/adblocker/resources/ublock-resources/metadata.json',
).json()
).revisions.pop()}/list.txt`,
).text(),
uBOResources,
'utf-8',
);

Expand Down Expand Up @@ -89,7 +94,7 @@ const adb = require('@cliqz/adblocker');
// ['fanboy', 'annoyance.txt'],
// ],
]) {
const lines = (await got(url).text())
const lines = (await fetch(url).then(r => r.text()))
.split(/[\r\n]/g)
.map((line) => line.trim())
.map((line) => {
Expand Down
1 change: 0 additions & 1 deletion packages/adblocker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
"chai": "^4.3.8",
"chai-as-promised": "^7.1.1",
"concurrently": "^8.2.1",
"got": "^13.0.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"rimraf": "^5.0.1",
Expand Down
123 changes: 6 additions & 117 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,6 @@ __metadata:
chai: ^4.3.8
chai-as-promised: ^7.1.1
concurrently: ^8.2.1
got: ^13.0.0
mocha: ^10.2.0
nyc: ^15.1.0
rimraf: ^5.0.1
Expand Down Expand Up @@ -1680,13 +1679,6 @@ __metadata:
languageName: node
linkType: hard

"@sindresorhus/is@npm:^5.2.0":
version: 5.6.0
resolution: "@sindresorhus/is@npm:5.6.0"
checksum: 2e6e0c3acf188dcd9aea0f324ac1b6ad04c9fc672392a7b5a1218512fcde066965797eba8b9fe2108657a504388bd4a6664e6e6602555168e828a6df08b9f10e
languageName: node
linkType: hard

"@sinonjs/commons@npm:^2.0.0":
version: 2.0.0
resolution: "@sinonjs/commons@npm:2.0.0"
Expand Down Expand Up @@ -1741,15 +1733,6 @@ __metadata:
languageName: node
linkType: hard

"@szmarczak/http-timer@npm:^5.0.1":
version: 5.0.1
resolution: "@szmarczak/http-timer@npm:5.0.1"
dependencies:
defer-to-connect: ^2.0.1
checksum: fc9cb993e808806692e4a3337c90ece0ec00c89f4b67e3652a356b89730da98bc824273a6d67ca84d5f33cd85f317dcd5ce39d8cc0a2f060145a608a7cb8ce92
languageName: node
linkType: hard

"@tootallnate/once@npm:2":
version: 2.0.0
resolution: "@tootallnate/once@npm:2.0.0"
Expand Down Expand Up @@ -1912,7 +1895,7 @@ __metadata:
languageName: node
linkType: hard

"@types/http-cache-semantics@npm:*, @types/http-cache-semantics@npm:^4.0.1":
"@types/http-cache-semantics@npm:*":
version: 4.0.2
resolution: "@types/http-cache-semantics@npm:4.0.2"
checksum: 513429786a45d8124f93cc7ea1454b692008190ef743e9fec75a6a3c998309782d216f1e67d7d497ffece9c9212310ae05a8c56e8955492ee400eacdd7620e61
Expand Down Expand Up @@ -2138,6 +2121,7 @@ __metadata:
lerna: ^7.3.0
prettier: ^3.0.3
tslint-no-unused-expression-chai: ^0.1.4
typescript: ^5.2.2
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -2685,28 +2669,6 @@ __metadata:
languageName: node
linkType: hard

"cacheable-lookup@npm:^7.0.0":
version: 7.0.0
resolution: "cacheable-lookup@npm:7.0.0"
checksum: 9e2856763fc0a7347ab34d704c010440b819d4bb5e3593b664381b7433e942dd22e67ee5581f12256f908e79b82d30b86ebbacf40a081bfe10ee93fbfbc2d6a9
languageName: node
linkType: hard

"cacheable-request@npm:^10.2.8":
version: 10.2.13
resolution: "cacheable-request@npm:10.2.13"
dependencies:
"@types/http-cache-semantics": ^4.0.1
get-stream: ^6.0.1
http-cache-semantics: ^4.1.1
keyv: ^4.5.3
mimic-response: ^4.0.0
normalize-url: ^8.0.0
responselike: ^3.0.0
checksum: 1a2e9a20558ff2e23156bf945110f16d08037830a57c7b97ba9a145f6526fff1e1da21b1a1f9f4ee5fda77a482374e1a537b60dc23dab5df506f5a1cea5be9ab
languageName: node
linkType: hard

"cacheable-request@npm:^7.0.2":
version: 7.0.4
resolution: "cacheable-request@npm:7.0.4"
Expand Down Expand Up @@ -3514,7 +3476,7 @@ __metadata:
languageName: node
linkType: hard

"defer-to-connect@npm:^2.0.0, defer-to-connect@npm:^2.0.1":
"defer-to-connect@npm:^2.0.0":
version: 2.0.1
resolution: "defer-to-connect@npm:2.0.1"
checksum: 8a9b50d2f25446c0bfefb55a48e90afd58f85b21bcf78e9207cd7b804354f6409032a1705c2491686e202e64fc05f147aa5aa45f9aa82627563f045937f5791b
Expand Down Expand Up @@ -4197,13 +4159,6 @@ __metadata:
languageName: node
linkType: hard

"form-data-encoder@npm:^2.1.2":
version: 2.1.4
resolution: "form-data-encoder@npm:2.1.4"
checksum: e0b3e5950fb69b3f32c273944620f9861f1933df9d3e42066e038e26dfb343d0f4465de9f27e0ead1a09d9df20bc2eed06a63c2ca2f8f00949e7202bae9e29dd
languageName: node
linkType: hard

"form-data@npm:^4.0.0":
version: 4.0.0
resolution: "form-data@npm:4.0.0"
Expand Down Expand Up @@ -4440,7 +4395,7 @@ __metadata:
languageName: node
linkType: hard

"get-stream@npm:^6.0.0, get-stream@npm:^6.0.1":
"get-stream@npm:^6.0.0":
version: 6.0.1
resolution: "get-stream@npm:6.0.1"
checksum: e04ecece32c92eebf5b8c940f51468cd53554dcbb0ea725b2748be583c9523d00128137966afce410b9b051eb2ef16d657cd2b120ca8edafcf5a65e81af63cad
Expand Down Expand Up @@ -4709,25 +4664,6 @@ __metadata:
languageName: node
linkType: hard

"got@npm:^13.0.0":
version: 13.0.0
resolution: "got@npm:13.0.0"
dependencies:
"@sindresorhus/is": ^5.2.0
"@szmarczak/http-timer": ^5.0.1
cacheable-lookup: ^7.0.0
cacheable-request: ^10.2.8
decompress-response: ^6.0.0
form-data-encoder: ^2.1.2
get-stream: ^6.0.1
http2-wrapper: ^2.1.10
lowercase-keys: ^3.0.0
p-cancelable: ^3.0.0
responselike: ^3.0.0
checksum: bcae6601efd710bc6c5b454c5e44bcb16fcfe57a1065e2d61ff918c1d69c3cf124984ebf509ca64ed10f0da2d2b5531b77da05aa786e75849d084fb8fbea711b
languageName: node
linkType: hard

"graceful-fs@npm:4.2.11, graceful-fs@npm:^4.1.11, graceful-fs@npm:^4.1.15, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.6":
version: 4.2.11
resolution: "graceful-fs@npm:4.2.11"
Expand Down Expand Up @@ -4920,16 +4856,6 @@ __metadata:
languageName: node
linkType: hard

"http2-wrapper@npm:^2.1.10":
version: 2.2.0
resolution: "http2-wrapper@npm:2.2.0"
dependencies:
quick-lru: ^5.1.1
resolve-alpn: ^1.2.0
checksum: 6fd20e5cb6a58151715b3581e06a62a47df943187d2d1f69e538a50cccb7175dd334ecfde7900a37d18f3e13a1a199518a2c211f39860e81e9a16210c199cfaa
languageName: node
linkType: hard

"https-proxy-agent@npm:^5.0.0, https-proxy-agent@npm:^5.0.1":
version: 5.0.1
resolution: "https-proxy-agent@npm:5.0.1"
Expand Down Expand Up @@ -5713,7 +5639,7 @@ __metadata:
languageName: node
linkType: hard

"keyv@npm:^4.0.0, keyv@npm:^4.5.3":
"keyv@npm:^4.0.0":
version: 4.5.3
resolution: "keyv@npm:4.5.3"
dependencies:
Expand Down Expand Up @@ -5974,13 +5900,6 @@ __metadata:
languageName: node
linkType: hard

"lowercase-keys@npm:^3.0.0":
version: 3.0.0
resolution: "lowercase-keys@npm:3.0.0"
checksum: 67a3f81409af969bc0c4ca0e76cd7d16adb1e25aa1c197229587eaf8671275c8c067cd421795dbca4c81be0098e4c426a086a05e30de8a9c587b7a13c0c7ccc5
languageName: node
linkType: hard

"lru-cache@npm:^5.1.1":
version: 5.1.1
resolution: "lru-cache@npm:5.1.1"
Expand Down Expand Up @@ -6190,13 +6109,6 @@ __metadata:
languageName: node
linkType: hard

"mimic-response@npm:^4.0.0":
version: 4.0.0
resolution: "mimic-response@npm:4.0.0"
checksum: 33b804cc961efe206efdb1fca6a22540decdcfce6c14eb5c0c50e5ae9022267ab22ce8f5568b1f7247ba67500fe20d523d81e0e9f009b321ccd9d472e78d1850
languageName: node
linkType: hard

"min-indent@npm:^1.0.0":
version: 1.0.1
resolution: "min-indent@npm:1.0.1"
Expand Down Expand Up @@ -6719,13 +6631,6 @@ __metadata:
languageName: node
linkType: hard

"normalize-url@npm:^8.0.0":
version: 8.0.0
resolution: "normalize-url@npm:8.0.0"
checksum: 24c20b75ebfd526d8453084692720b49d111c63c0911f1b7447427829597841eef5a8ba3f6bb93d6654007b991c1f5cd85da2c907800e439e2e2ec6c2abd0fc0
languageName: node
linkType: hard

"npm-bundled@npm:^1.1.2":
version: 1.1.2
resolution: "npm-bundled@npm:1.1.2"
Expand Down Expand Up @@ -7071,13 +6976,6 @@ __metadata:
languageName: node
linkType: hard

"p-cancelable@npm:^3.0.0":
version: 3.0.0
resolution: "p-cancelable@npm:3.0.0"
checksum: 2b5ae34218f9c2cf7a7c18e5d9a726ef9b165ef07e6c959f6738371509e747334b5f78f3bcdeb03d8a12dcb978faf641fd87eb21486ed7d36fb823b8ddef3219
languageName: node
linkType: hard

"p-finally@npm:^1.0.0":
version: 1.0.0
resolution: "p-finally@npm:1.0.0"
Expand Down Expand Up @@ -7973,7 +7871,7 @@ __metadata:
languageName: node
linkType: hard

"resolve-alpn@npm:^1.0.0, resolve-alpn@npm:^1.2.0":
"resolve-alpn@npm:^1.0.0":
version: 1.2.1
resolution: "resolve-alpn@npm:1.2.1"
checksum: f558071fcb2c60b04054c99aebd572a2af97ef64128d59bef7ab73bd50d896a222a056de40ffc545b633d99b304c259ea9d0c06830d5c867c34f0bfa60b8eae0
Expand Down Expand Up @@ -8056,15 +7954,6 @@ __metadata:
languageName: node
linkType: hard

"responselike@npm:^3.0.0":
version: 3.0.0
resolution: "responselike@npm:3.0.0"
dependencies:
lowercase-keys: ^3.0.0
checksum: e0cc9be30df4f415d6d83cdede3c5c887cd4a73e7cc1708bcaab1d50a28d15acb68460ac5b02bcc55a42f3d493729c8856427dcf6e57e6e128ad05cba4cfb95e
languageName: node
linkType: hard

"restore-cursor@npm:^3.1.0":
version: 3.1.0
resolution: "restore-cursor@npm:3.1.0"
Expand Down