msgpackr-extract 1.0.16 → 1.1.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.gyp +17 -3
- package/index.js +1 -1
- package/package.json +42 -30
- package/src/.vs/ProjectSettings.json +3 -0
- package/src/.vs/VSWorkspaceState.json +7 -0
- package/src/.vs/slnx.sqlite +0 -0
- package/src/.vs/src/v16/.suo +0 -0
- package/src/.vs/src/v16/Browse.VC.db +0 -0
- package/{prebuilds/darwin-x64/node.abi72.node → src/.vs/src/v16/Browse.VC.db-shm} +0 -0
- package/src/.vs/src/v16/Browse.VC.db-wal +0 -0
- package/src/extract.cpp +87 -66
- package/.circleci/config.yml +0 -19
- package/.github/workflows/prebuild.yml +0 -87
- package/.travis.yml +0 -30
- package/prebuilds/darwin-arm64/electron.abi98.node +0 -0
- package/prebuilds/darwin-arm64/node.abi102.node +0 -0
- package/prebuilds/darwin-arm64/node.abi83.node +0 -0
- package/prebuilds/darwin-arm64/node.abi93.node +0 -0
- package/prebuilds/darwin-x64/electron.abi98.node +0 -0
- package/prebuilds/darwin-x64/node.abi102.node +0 -0
- package/prebuilds/darwin-x64/node.abi83.node +0 -0
- package/prebuilds/darwin-x64/node.abi88.node +0 -0
- package/prebuilds/darwin-x64/node.abi93.node +0 -0
- package/prebuilds/linux-arm64/electron.abi98.node +0 -0
- package/prebuilds/linux-arm64/node.abi102.node +0 -0
- package/prebuilds/linux-arm64/node.abi83.node +0 -0
- package/prebuilds/linux-arm64/node.abi93.node +0 -0
- package/prebuilds/linux-x64/electron.abi98.node +0 -0
- package/prebuilds/linux-x64/node.abi102.musl.node +0 -0
- package/prebuilds/linux-x64/node.abi102.node +0 -0
- package/prebuilds/linux-x64/node.abi72.musl.node +0 -0
- package/prebuilds/linux-x64/node.abi72.node +0 -0
- package/prebuilds/linux-x64/node.abi83.musl.node +0 -0
- package/prebuilds/linux-x64/node.abi83.node +0 -0
- package/prebuilds/linux-x64/node.abi88.node +0 -0
- package/prebuilds/linux-x64/node.abi93.musl.node +0 -0
- package/prebuilds/linux-x64/node.abi93.node +0 -0
- package/prebuilds/win32-x64/electron.abi98.node +0 -0
- package/prebuilds/win32-x64/node.abi102.node +0 -0
- package/prebuilds/win32-x64/node.abi72.node +0 -0
- package/prebuilds/win32-x64/node.abi83.node +0 -0
- package/prebuilds/win32-x64/node.abi88.node +0 -0
- package/prebuilds/win32-x64/node.abi93.node +0 -0
package/binding.gyp
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"variables": {
|
|
3
3
|
"os_linux_compiler%": "gcc",
|
|
4
|
+
"enable_v8%": "true",
|
|
4
5
|
"build_v8_with_gn": "false"
|
|
5
6
|
},
|
|
7
|
+
"conditions": [
|
|
8
|
+
['OS=="win"', {
|
|
9
|
+
"variables": {
|
|
10
|
+
"enable_v8%": "<!(echo %ENABLE_V8_FUNCTIONS%)",
|
|
11
|
+
}
|
|
12
|
+
}],
|
|
13
|
+
['OS!="win"', {
|
|
14
|
+
"variables": {
|
|
15
|
+
"enable_v8%": "<!(echo $ENABLE_V8_FUNCTIONS%)",
|
|
16
|
+
}
|
|
17
|
+
}]
|
|
18
|
+
],
|
|
6
19
|
"targets": [
|
|
7
20
|
{
|
|
8
21
|
"target_name": "msgpackr-extract",
|
|
@@ -10,9 +23,7 @@
|
|
|
10
23
|
"sources": [
|
|
11
24
|
"src/extract.cpp",
|
|
12
25
|
],
|
|
13
|
-
"
|
|
14
|
-
"<!(node -e \"require('nan')\")",
|
|
15
|
-
],
|
|
26
|
+
"defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ],
|
|
16
27
|
"conditions": [
|
|
17
28
|
["OS=='linux'", {
|
|
18
29
|
"variables": {
|
|
@@ -40,6 +51,9 @@
|
|
|
40
51
|
"-O3"
|
|
41
52
|
],
|
|
42
53
|
}],
|
|
54
|
+
["enable_v8!='false'", {
|
|
55
|
+
"defines": ["ENABLE_V8_API=1"],
|
|
56
|
+
}],
|
|
43
57
|
],
|
|
44
58
|
}
|
|
45
59
|
]
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = require('node-gyp-build')(__dirname)
|
|
1
|
+
module.exports = require('node-gyp-build')(__dirname);
|
package/package.json
CHANGED
|
@@ -1,30 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "msgpackr-extract",
|
|
3
|
-
"author": "Kris Zyp",
|
|
4
|
-
"version": "1.0
|
|
5
|
-
"description": "Node addon for string extraction for msgpackr",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "http://github.com/kriszyp/msgpackr-extract"
|
|
10
|
-
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"install": "node-gyp-build",
|
|
13
|
-
"recompile": "node-gyp build",
|
|
14
|
-
"before-publish": "prebuildify-ci download && prebuildify --
|
|
15
|
-
"prebuild": "prebuildify --
|
|
16
|
-
"prebuild-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"node-gyp-build": "
|
|
25
|
-
},
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "msgpackr-extract",
|
|
3
|
+
"author": "Kris Zyp",
|
|
4
|
+
"version": "1.1.0-beta",
|
|
5
|
+
"description": "Node addon for string extraction for msgpackr",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "http://github.com/kriszyp/msgpackr-extract"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"install": "node-gyp-build",
|
|
13
|
+
"recompile": "node-gyp build",
|
|
14
|
+
"before-publish": "prebuildify-ci download && prebuildify --optional-packages --napi --target 12.22.7 && prebuildify --optional-packages --target 16.14.0",
|
|
15
|
+
"prebuild": "prebuildify --optional-packages --napi --target 16.14.0 && prebuildify --optional-packages --target 16.14.0",
|
|
16
|
+
"prebuild-libc": "prebuildify --optional-packages --napi --tag-libc --target 16.14.0 && prebuildify --optional-packages --tag-libc --target 16.14.0",
|
|
17
|
+
"prepublishOnly": "node set-optional-deps.cjs",
|
|
18
|
+
"publish-all": "cd prebuilds/win32-x64 && npm publish --otp %OTP% && cd ../darwin-x64 && npm publish --otp %OTP% && cd ../darwin-arm64 && npm publish --otp %OTP% && cd ../linux-x64 && npm publish --otp %OTP% && cd ../linux-arm64 && npm publish --otp %OTP% && cd ../.. && npm publish --otp %OTP%",
|
|
19
|
+
"test": "node ./index.js"
|
|
20
|
+
},
|
|
21
|
+
"main": "./index.js",
|
|
22
|
+
"gypfile": true,
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"node-gyp-build": "kriszyp/node-gyp-build#optional-packages"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"index.js",
|
|
28
|
+
"/src",
|
|
29
|
+
"/*.gyp"
|
|
30
|
+
],
|
|
31
|
+
"optionalDependencies": {
|
|
32
|
+
"msgpackr-extract-darwin-arm64": "1.1.0-beta",
|
|
33
|
+
"msgpackr-extract-darwin-x64": "1.1.0-beta",
|
|
34
|
+
"msgpackr-extract-linux-arm64": "1.1.0-beta",
|
|
35
|
+
"msgpackr-extract-linux-x64": "1.1.0-beta",
|
|
36
|
+
"msgpackr-extract-win32-x64": "1.1.0-beta"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"prebuildify": "kriszyp/prebuildify#optional-packages",
|
|
40
|
+
"prebuildify-ci": "^1.0.5"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
package/src/extract.cpp
CHANGED
|
@@ -5,11 +5,10 @@ provides much better performance. This will parse and produce up to 256 strings
|
|
|
5
5
|
times as necessary to get more strings. This must be partially capable of parsing MessagePack so it can know where to
|
|
6
6
|
find the string tokens and determine their position and length. All strings are decoded as UTF-8.
|
|
7
7
|
*/
|
|
8
|
+
#include <node_api.h>
|
|
9
|
+
#if ENABLE_V8_API
|
|
8
10
|
#include <v8.h>
|
|
9
|
-
#
|
|
10
|
-
#include <node_buffer.h>
|
|
11
|
-
#include <nan.h>
|
|
12
|
-
using namespace v8;
|
|
11
|
+
#endif
|
|
13
12
|
|
|
14
13
|
#ifndef thread_local
|
|
15
14
|
#ifdef __GNUC__
|
|
@@ -26,17 +25,25 @@ using namespace v8;
|
|
|
26
25
|
const int MAX_TARGET_SIZE = 255;
|
|
27
26
|
typedef int (*token_handler)(uint8_t* source, int position, int size);
|
|
28
27
|
token_handler tokenTable[256] = {};
|
|
28
|
+
napi_value unexpectedEnd(napi_env env) {
|
|
29
|
+
napi_value returnValue;
|
|
30
|
+
napi_get_undefined(env, &returnValue);
|
|
31
|
+
napi_throw_type_error(env, NULL, "Unexpected end of buffer reading string");
|
|
32
|
+
return returnValue;
|
|
33
|
+
}
|
|
34
|
+
|
|
29
35
|
class Extractor {
|
|
30
36
|
public:
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
napi_value target[MAX_TARGET_SIZE + 1]; // leave one for the queued string
|
|
38
|
+
// napi_ref targetArray; // could consider reenabling this optimization for napi
|
|
39
|
+
bool hasTargetArray = false;
|
|
33
40
|
uint8_t* source;
|
|
34
41
|
int position = 0;
|
|
35
42
|
int writePosition = 0;
|
|
36
43
|
int stringStart = 0;
|
|
37
44
|
int lastStringEnd = 0;
|
|
38
|
-
|
|
39
|
-
void readString(int length, bool allowStringBlocks) {
|
|
45
|
+
|
|
46
|
+
void readString(napi_env env, int length, bool allowStringBlocks) {
|
|
40
47
|
int start = position;
|
|
41
48
|
int end = position + length;
|
|
42
49
|
if (allowStringBlocks) { // for larger strings, we don't bother to check every character for being latin, and just go right to creating a new string
|
|
@@ -51,18 +58,24 @@ public:
|
|
|
51
58
|
if (position < end) {
|
|
52
59
|
// non-latin character
|
|
53
60
|
if (lastStringEnd) {
|
|
54
|
-
|
|
61
|
+
napi_value value;
|
|
62
|
+
napi_create_string_latin1(env, (const char*) source + stringStart, lastStringEnd - stringStart, &value);
|
|
63
|
+
target[writePosition++] = value;
|
|
55
64
|
lastStringEnd = 0;
|
|
56
65
|
}
|
|
57
66
|
// use standard utf-8 conversion
|
|
58
|
-
|
|
67
|
+
napi_value value;
|
|
68
|
+
napi_create_string_utf8(env, (const char*) source + start, (int) length, &value);
|
|
69
|
+
target[writePosition++] = value;
|
|
59
70
|
position = end;
|
|
60
71
|
return;
|
|
61
72
|
}
|
|
62
73
|
|
|
63
74
|
if (lastStringEnd) {
|
|
64
75
|
if (start - lastStringEnd > 40 || end - stringStart > 6000) {
|
|
65
|
-
|
|
76
|
+
napi_value value;
|
|
77
|
+
napi_create_string_latin1(env, (const char*) source + stringStart, lastStringEnd - stringStart, &value);
|
|
78
|
+
target[writePosition++] = value;
|
|
66
79
|
stringStart = start;
|
|
67
80
|
}
|
|
68
81
|
} else {
|
|
@@ -71,7 +84,7 @@ public:
|
|
|
71
84
|
lastStringEnd = end;
|
|
72
85
|
}
|
|
73
86
|
|
|
74
|
-
|
|
87
|
+
napi_value extractStrings(napi_env env, int startingPosition, int size, uint8_t* inputSource) {
|
|
75
88
|
writePosition = 0;
|
|
76
89
|
lastStringEnd = 0;
|
|
77
90
|
position = startingPosition;
|
|
@@ -84,50 +97,43 @@ public:
|
|
|
84
97
|
// fixstr, we want to convert this
|
|
85
98
|
token -= 0xa0;
|
|
86
99
|
if (token + position > size) {
|
|
87
|
-
|
|
88
|
-
return Nan::Null();
|
|
100
|
+
return unexpectedEnd(env);
|
|
89
101
|
}
|
|
90
|
-
readString(token, true);
|
|
102
|
+
readString(env,token, true);
|
|
91
103
|
if (writePosition >= MAX_TARGET_SIZE)
|
|
92
104
|
break;
|
|
93
105
|
} else if (token <= 0xdb && token >= 0xd9) {
|
|
94
106
|
if (token == 0xd9) { //str 8
|
|
95
107
|
if (position >= size) {
|
|
96
|
-
|
|
97
|
-
return Nan::Null();
|
|
108
|
+
return unexpectedEnd(env);
|
|
98
109
|
}
|
|
99
110
|
int length = source[position++];
|
|
100
111
|
if (length + position > size) {
|
|
101
|
-
|
|
102
|
-
return Nan::Null();
|
|
112
|
+
return unexpectedEnd(env);
|
|
103
113
|
}
|
|
104
|
-
readString(length, true);
|
|
114
|
+
readString(env,length, true);
|
|
105
115
|
} else if (token == 0xda) { //str 16
|
|
106
116
|
if (2 + position > size) {
|
|
107
|
-
|
|
108
|
-
return Nan::Null();
|
|
117
|
+
return unexpectedEnd(env);
|
|
109
118
|
}
|
|
110
119
|
int length = source[position++] << 8;
|
|
111
120
|
length += source[position++];
|
|
112
121
|
if (length + position > size) {
|
|
113
|
-
|
|
114
|
-
return Nan::Null();
|
|
122
|
+
return unexpectedEnd(env);
|
|
115
123
|
}
|
|
116
|
-
readString(length, false);
|
|
124
|
+
readString(env,length, false);
|
|
117
125
|
} else { //str 32
|
|
118
126
|
if (4 + position > size) {
|
|
119
|
-
|
|
120
|
-
return Nan::Null();
|
|
127
|
+
return unexpectedEnd(env);
|
|
121
128
|
}
|
|
122
129
|
int length = source[position++] << 24;
|
|
123
130
|
length += source[position++] << 16;
|
|
124
131
|
length += source[position++] << 8;
|
|
125
132
|
length += source[position++];
|
|
126
133
|
if (length + position > size) {
|
|
127
|
-
|
|
128
|
-
return Nan::Null();
|
|
134
|
+
return unexpectedEnd(env);
|
|
129
135
|
}
|
|
130
|
-
readString(length, false);
|
|
136
|
+
readString(env, length, false);
|
|
131
137
|
}
|
|
132
138
|
if (writePosition >= MAX_TARGET_SIZE)
|
|
133
139
|
break;
|
|
@@ -138,32 +144,52 @@ public:
|
|
|
138
144
|
} else {
|
|
139
145
|
position = tokenTable[token](source, position, size);
|
|
140
146
|
if (position < 0) {
|
|
141
|
-
|
|
142
|
-
return Nan::Null();
|
|
147
|
+
return unexpectedEnd(env);
|
|
143
148
|
}
|
|
144
149
|
}
|
|
145
150
|
}
|
|
146
151
|
}
|
|
147
152
|
|
|
148
153
|
if (lastStringEnd) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
154
|
+
napi_value value;
|
|
155
|
+
napi_create_string_latin1(env, (const char*) source + stringStart, lastStringEnd - stringStart, &value);
|
|
156
|
+
if (writePosition == 0) {
|
|
157
|
+
/*if (!hasTargetArray) {
|
|
158
|
+
hasTargetArray = true;
|
|
159
|
+
napi_create_reference(env, array, 1, &targetArray);
|
|
160
|
+
}*/
|
|
161
|
+
return value;
|
|
162
|
+
}
|
|
163
|
+
target[writePosition++] = value;
|
|
152
164
|
} else if (writePosition == 1) {
|
|
165
|
+
/*if (!hasTargetArray) {
|
|
166
|
+
hasTargetArray = true;
|
|
167
|
+
napi_create_reference(env, array, 1, &targetArray);
|
|
168
|
+
}*/
|
|
153
169
|
return target[0];
|
|
154
170
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
171
|
+
napi_value array;
|
|
172
|
+
#if ENABLE_V8_API
|
|
173
|
+
v8::Local<v8::Array> v8Array = v8::Array::New(v8::Isolate::GetCurrent(), (v8::Local<v8::Value>*) target, writePosition);
|
|
174
|
+
memcpy(&array, &v8Array, sizeof(array));
|
|
175
|
+
#else
|
|
176
|
+
napi_create_array_with_length(env, writePosition, &array);
|
|
177
|
+
/*if (hasTargetArray) {
|
|
178
|
+
napi_get_reference_value(env, targetArray, &array);
|
|
179
|
+
hasTargetArray = false;
|
|
180
|
+
}*/
|
|
160
181
|
for (int i = 0; i < writePosition; i++) {
|
|
161
|
-
|
|
162
|
-
}
|
|
182
|
+
napi_set_element(env, array, i, target[i]);
|
|
183
|
+
}/*
|
|
184
|
+
napi_value length;
|
|
185
|
+
napi_create_int32(env, i, &length);
|
|
186
|
+
return length;
|
|
187
|
+
napi_set_element(env, array, i, undefined); */
|
|
188
|
+
#endif
|
|
163
189
|
return array;
|
|
164
|
-
#endif
|
|
165
190
|
}
|
|
166
191
|
};
|
|
192
|
+
|
|
167
193
|
void setupTokenTable() {
|
|
168
194
|
for (int i = 0; i < 256; i++) {
|
|
169
195
|
tokenTable[i] = nullptr;
|
|
@@ -187,8 +213,7 @@ void setupTokenTable() {
|
|
|
187
213
|
// bin 8
|
|
188
214
|
tokenTable[0xc4] = ([](uint8_t* source, int position, int size) -> int {
|
|
189
215
|
if (position >= size) {
|
|
190
|
-
|
|
191
|
-
return size;
|
|
216
|
+
return -1;
|
|
192
217
|
}
|
|
193
218
|
int length = source[position++];
|
|
194
219
|
return position + length;
|
|
@@ -196,8 +221,7 @@ void setupTokenTable() {
|
|
|
196
221
|
// bin 16
|
|
197
222
|
tokenTable[0xc5] = ([](uint8_t* source, int position, int size) -> int {
|
|
198
223
|
if (position + 2 > size) {
|
|
199
|
-
|
|
200
|
-
return size;
|
|
224
|
+
return -1;
|
|
201
225
|
}
|
|
202
226
|
int length = source[position++] << 8;
|
|
203
227
|
length += source[position++];
|
|
@@ -242,28 +266,25 @@ void setupTokenTable() {
|
|
|
242
266
|
return position + length;
|
|
243
267
|
});
|
|
244
268
|
}
|
|
245
|
-
|
|
246
269
|
static thread_local Extractor* extractor;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
NAN_METHOD(isOneByte) {
|
|
259
|
-
info.GetReturnValue().Set(Nan::New<Boolean>(Local<String>::Cast(info[0])->IsOneByte()));
|
|
270
|
+
napi_value extractStrings(napi_env env, napi_callback_info info) {
|
|
271
|
+
size_t argc = 3;
|
|
272
|
+
napi_value args[3];
|
|
273
|
+
napi_get_cb_info(env, info, &argc, args, NULL, NULL);
|
|
274
|
+
uint32_t position;
|
|
275
|
+
uint32_t size;
|
|
276
|
+
napi_get_value_uint32(env, args[0], &position);
|
|
277
|
+
napi_get_value_uint32(env, args[1], &size);
|
|
278
|
+
uint8_t* source;
|
|
279
|
+
napi_get_typedarray_info(env, args[2], NULL, NULL, (void**) &source, NULL, NULL);
|
|
280
|
+
return extractor->extractStrings(env, position, size, source);
|
|
260
281
|
}
|
|
261
|
-
|
|
262
|
-
|
|
282
|
+
#define EXPORT_NAPI_FUNCTION(name, func) { napi_property_descriptor desc = { name, 0, func, 0, 0, 0, (napi_property_attributes) (napi_writable | napi_configurable), 0 }; napi_define_properties(env, exports, 1, &desc); }
|
|
283
|
+
napi_value Init(napi_env env, napi_value exports) {
|
|
263
284
|
extractor = new Extractor(); // create our thread-local extractor
|
|
264
285
|
setupTokenTable();
|
|
265
|
-
|
|
266
|
-
|
|
286
|
+
EXPORT_NAPI_FUNCTION("extractStrings", extractStrings);
|
|
287
|
+
return exports;
|
|
267
288
|
}
|
|
268
289
|
|
|
269
|
-
|
|
290
|
+
NAPI_MODULE(extractor, Init)
|
package/.circleci/config.yml
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
name: Test and Prebuild
|
|
2
|
-
jobs:
|
|
3
|
-
build:
|
|
4
|
-
executor: my-ubuntu-exec
|
|
5
|
-
steps:
|
|
6
|
-
- uses: actions/checkout@v2
|
|
7
|
-
- name: Setup node
|
|
8
|
-
uses: actions/setup-node@v2
|
|
9
|
-
with:
|
|
10
|
-
node-version: 12
|
|
11
|
-
- run: npm install
|
|
12
|
-
- run: npm run prebuild
|
|
13
|
-
- run: zip -r prebuild-darwin.zip prebuilds
|
|
14
|
-
- run: hexdump "prebuilds/darwin-x64/node.abi93.node" | head -10
|
|
15
|
-
- name: Prebuild
|
|
16
|
-
uses: softprops/action-gh-release@v1
|
|
17
|
-
if: startsWith(github.ref, 'refs/tags/')
|
|
18
|
-
with:
|
|
19
|
-
files: prebuild-darwin.zip
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
name: Prebuild
|
|
2
|
-
on: [push]
|
|
3
|
-
jobs:
|
|
4
|
-
build-test-macos:
|
|
5
|
-
if: startsWith(github.ref, 'refs/tags/')
|
|
6
|
-
runs-on: macos-11
|
|
7
|
-
steps:
|
|
8
|
-
- uses: actions/checkout@v2
|
|
9
|
-
- name: Setup node
|
|
10
|
-
uses: actions/setup-node@v2
|
|
11
|
-
with:
|
|
12
|
-
node-version: 12
|
|
13
|
-
- run: npm install
|
|
14
|
-
- run: npm test
|
|
15
|
-
- run: npm run prebuild
|
|
16
|
-
if: startsWith(github.ref, 'refs/tags/')
|
|
17
|
-
- run: npm run prebuild-arm64
|
|
18
|
-
if: startsWith(github.ref, 'refs/tags/')
|
|
19
|
-
- run: tar --create --format ustar --verbose --file=prebuild-darwin.tar -C prebuilds .
|
|
20
|
-
if: startsWith(github.ref, 'refs/tags/')
|
|
21
|
-
- name: Prebuild
|
|
22
|
-
uses: softprops/action-gh-release@v1
|
|
23
|
-
if: startsWith(github.ref, 'refs/tags/')
|
|
24
|
-
with:
|
|
25
|
-
files: prebuild-darwin.tar
|
|
26
|
-
build-centos-7:
|
|
27
|
-
if: startsWith(github.ref, 'refs/tags/')
|
|
28
|
-
runs-on: ubuntu-18.04
|
|
29
|
-
container: quay.io/pypa/manylinux2014_x86_64
|
|
30
|
-
steps:
|
|
31
|
-
- run: ldd --version ldd
|
|
32
|
-
- uses: actions/checkout@v2
|
|
33
|
-
- name: Setup node
|
|
34
|
-
uses: actions/setup-node@v2
|
|
35
|
-
with:
|
|
36
|
-
node-version: 12
|
|
37
|
-
- run: npm install
|
|
38
|
-
- run: npm run prebuild
|
|
39
|
-
- run: npm test
|
|
40
|
-
- run: tar --create --verbose --file=prebuild-linux.tar -C prebuilds .
|
|
41
|
-
- name: Prebuild
|
|
42
|
-
if: startsWith(github.ref, 'refs/tags/')
|
|
43
|
-
uses: softprops/action-gh-release@v1
|
|
44
|
-
with:
|
|
45
|
-
files: prebuild-linux.tar
|
|
46
|
-
build-alpine:
|
|
47
|
-
if: startsWith(github.ref, 'refs/tags/')
|
|
48
|
-
runs-on: ubuntu-18.04
|
|
49
|
-
container: node:12-alpine
|
|
50
|
-
steps:
|
|
51
|
-
- run: apk add python3 py3-pip build-base
|
|
52
|
-
- uses: actions/checkout@v2
|
|
53
|
-
- run: npm install
|
|
54
|
-
- run: npm run prebuild-musl
|
|
55
|
-
- run: npm test
|
|
56
|
-
- run: tar --create --verbose --file=prebuild-alpine.tar -C prebuilds .
|
|
57
|
-
- name: Prebuild
|
|
58
|
-
if: startsWith(github.ref, 'refs/tags/')
|
|
59
|
-
uses: softprops/action-gh-release@v1
|
|
60
|
-
with:
|
|
61
|
-
files: prebuild-alpine.tar
|
|
62
|
-
build-linux-arm64:
|
|
63
|
-
if: startsWith(github.ref, 'refs/tags/')
|
|
64
|
-
runs-on: ubuntu-18.04
|
|
65
|
-
container: quay.io/pypa/manylinux_2_24_x86_64
|
|
66
|
-
steps:
|
|
67
|
-
- run: apt-get update
|
|
68
|
-
- run: apt-get install -y gcc-aarch64-linux-gnu
|
|
69
|
-
- run: apt-get install -y g++-aarch64-linux-gnu
|
|
70
|
-
- run: ldd --version ldd
|
|
71
|
-
- uses: actions/checkout@v2
|
|
72
|
-
- name: Setup node
|
|
73
|
-
uses: actions/setup-node@v2
|
|
74
|
-
with:
|
|
75
|
-
node-version: 12
|
|
76
|
-
- run: npm install
|
|
77
|
-
- run: npm run prebuild-arm64
|
|
78
|
-
if: startsWith(github.ref, 'refs/tags/')
|
|
79
|
-
env:
|
|
80
|
-
CC: aarch64-linux-gnu-gcc
|
|
81
|
-
CXX: aarch64-linux-gnu-g++
|
|
82
|
-
- run: tar --create --verbose --file=prebuild-linux-arm64.tar -C prebuilds .
|
|
83
|
-
- name: Prebuild
|
|
84
|
-
if: startsWith(github.ref, 'refs/tags/')
|
|
85
|
-
uses: softprops/action-gh-release@v1
|
|
86
|
-
with:
|
|
87
|
-
files: prebuild-linux-arm64.tar
|
package/.travis.yml
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
sudo: false
|
|
2
|
-
language: node_js
|
|
3
|
-
node_js:
|
|
4
|
-
- node
|
|
5
|
-
addons:
|
|
6
|
-
apt:
|
|
7
|
-
sources:
|
|
8
|
-
- ubuntu-toolchain-r-test
|
|
9
|
-
arch:
|
|
10
|
-
- amd64
|
|
11
|
-
- arm64
|
|
12
|
-
os:
|
|
13
|
-
- osx
|
|
14
|
-
- linux
|
|
15
|
-
osx_image: xcode12.5
|
|
16
|
-
before_deploy:
|
|
17
|
-
- ARCHIVE_NAME="${TRAVIS_TAG:-latest}-$TRAVIS_OS_NAME-`uname -m`.tar"
|
|
18
|
-
- npm run prebuild
|
|
19
|
-
- tar --create --verbose --file="$ARCHIVE_NAME" --directory "$TRAVIS_BUILD_DIR/prebuilds"
|
|
20
|
-
.
|
|
21
|
-
deploy:
|
|
22
|
-
provider: releases
|
|
23
|
-
draft: false
|
|
24
|
-
prerelease: true
|
|
25
|
-
file: "$ARCHIVE_NAME"
|
|
26
|
-
skip_cleanup: true
|
|
27
|
-
on:
|
|
28
|
-
tags: true
|
|
29
|
-
node: node
|
|
30
|
-
api_key: '$GITHUB_API_KEY'
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|