cordova-plugin-insider 1.3.0 → 1.5.0
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/package.json +1 -1
- package/plugin.xml +6 -6
- package/src/android/Constants.java +1 -0
- package/src/android/InsiderPlugin.java +29 -3
- package/src/android/build-extras.gradle +5 -6
- package/src/ios/InsiderPlugin.h +2 -0
- package/src/ios/InsiderPlugin.m +30 -10
- package/types/InsiderPlugin.d.ts +1 -0
- package/types/Product.d.ts +1 -0
- package/www/CallbackType.js +1 -0
- package/www/Constants.js +3 -1
- package/www/Event.js +24 -7
- package/www/Identifier.js +16 -4
- package/www/InsiderPlugin.js +166 -20
- package/www/Product.js +80 -17
- package/www/User.js +99 -27
- package/www/Utils.js +7 -5
- package/.github/CODEOWNERS +0 -8
- package/.github/workflows/git-leak.yml +0 -25
- package/.github/workflows/insider-cordova-SDK_release.yml +0 -61
- package/.github/workflows/release_task_merger.yml +0 -22
- package/.github/workflows/release_version_setter.yml +0 -43
- package/release_version.sh +0 -27
- package/slack_notifier.sh +0 -20
package/www/User.js
CHANGED
|
@@ -7,7 +7,10 @@ class User {
|
|
|
7
7
|
constructor() {}
|
|
8
8
|
|
|
9
9
|
setGender(gender) {
|
|
10
|
-
if (
|
|
10
|
+
if (Utils.checkParameters([{ type: 'number', value: gender }])) {
|
|
11
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setGender');
|
|
12
|
+
return this;
|
|
13
|
+
}
|
|
11
14
|
|
|
12
15
|
try {
|
|
13
16
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_GENDER, [gender]);
|
|
@@ -19,7 +22,10 @@ class User {
|
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
setBirthday(birthday) {
|
|
22
|
-
if (
|
|
25
|
+
if (Utils.checkParameters([{ type: 'string', value: birthday }])) {
|
|
26
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setBirthday');
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
23
29
|
|
|
24
30
|
try {
|
|
25
31
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_BIRTDAY, [birthday.toISOString()]);
|
|
@@ -30,7 +36,10 @@ class User {
|
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
setName(name) {
|
|
33
|
-
if (
|
|
39
|
+
if (Utils.checkParameters([{ type: 'string', value: name }])) {
|
|
40
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setName');
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
34
43
|
|
|
35
44
|
try {
|
|
36
45
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_NAME, [name]);
|
|
@@ -41,7 +50,10 @@ class User {
|
|
|
41
50
|
}
|
|
42
51
|
|
|
43
52
|
setSurname(surname) {
|
|
44
|
-
if (
|
|
53
|
+
if (Utils.checkParameters([{ type: 'string', value: surname }])) {
|
|
54
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setSurname');
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
45
57
|
|
|
46
58
|
try {
|
|
47
59
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_SURNAME, [surname]);
|
|
@@ -53,7 +65,10 @@ class User {
|
|
|
53
65
|
}
|
|
54
66
|
|
|
55
67
|
setAge(age) {
|
|
56
|
-
if (
|
|
68
|
+
if (Utils.checkParameters([{ type: 'string', value: age }])) {
|
|
69
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setAge');
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
57
72
|
|
|
58
73
|
try {
|
|
59
74
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_AGE, [age]);
|
|
@@ -66,7 +81,10 @@ class User {
|
|
|
66
81
|
|
|
67
82
|
|
|
68
83
|
setEmail(email) {
|
|
69
|
-
if (
|
|
84
|
+
if (Utils.checkParameters([{ type: 'string', value: email }])) {
|
|
85
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setEmail');
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
70
88
|
|
|
71
89
|
try {
|
|
72
90
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_EMAIL, [email]);
|
|
@@ -78,7 +96,10 @@ class User {
|
|
|
78
96
|
}
|
|
79
97
|
|
|
80
98
|
setPhoneNumber(phone) {
|
|
81
|
-
if (
|
|
99
|
+
if (Utils.checkParameters([{ type: 'string', value: phone }])) {
|
|
100
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setPhoneNumber');
|
|
101
|
+
return this;
|
|
102
|
+
}
|
|
82
103
|
|
|
83
104
|
try {
|
|
84
105
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_PHONE_NUMBER, [phone]);
|
|
@@ -90,7 +111,10 @@ class User {
|
|
|
90
111
|
}
|
|
91
112
|
|
|
92
113
|
setLanguage(language) {
|
|
93
|
-
if (
|
|
114
|
+
if (Utils.checkParameters([{ type: 'string', value: language }])) {
|
|
115
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setLanguage');
|
|
116
|
+
return this;
|
|
117
|
+
}
|
|
94
118
|
|
|
95
119
|
try {
|
|
96
120
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_LANGUAGE, [language]);
|
|
@@ -102,7 +126,10 @@ class User {
|
|
|
102
126
|
}
|
|
103
127
|
|
|
104
128
|
setLocale(locale) {
|
|
105
|
-
if (
|
|
129
|
+
if (Utils.checkParameters([{ type: 'string', value: locale }])) {
|
|
130
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setLocale');
|
|
131
|
+
return this;
|
|
132
|
+
}
|
|
106
133
|
|
|
107
134
|
try {
|
|
108
135
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_LOCALE, [locale]);
|
|
@@ -114,7 +141,10 @@ class User {
|
|
|
114
141
|
}
|
|
115
142
|
|
|
116
143
|
setFacebookID(facebookID) {
|
|
117
|
-
if (
|
|
144
|
+
if (Utils.checkParameters([{ type: 'string', value: facebookID }])) {
|
|
145
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setFacebookID');
|
|
146
|
+
return this;
|
|
147
|
+
}
|
|
118
148
|
|
|
119
149
|
try {
|
|
120
150
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_FACEBOOK_ID, [facebookID]);
|
|
@@ -126,7 +156,10 @@ class User {
|
|
|
126
156
|
}
|
|
127
157
|
|
|
128
158
|
setTwitterID(twitterID) {
|
|
129
|
-
if (
|
|
159
|
+
if (Utils.checkParameters([{ type: 'string', value: twitterID }])) {
|
|
160
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setTwitterID');
|
|
161
|
+
return this;
|
|
162
|
+
}
|
|
130
163
|
|
|
131
164
|
try {
|
|
132
165
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_TWITTER_ID, [twitterID]);
|
|
@@ -138,7 +171,10 @@ class User {
|
|
|
138
171
|
}
|
|
139
172
|
|
|
140
173
|
setEmailOptin(emailOptIn) {
|
|
141
|
-
if (
|
|
174
|
+
if (Utils.checkParameters([{ type: 'boolean', value: emailOptIn }])) {
|
|
175
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setEmailOptin');
|
|
176
|
+
return this;
|
|
177
|
+
}
|
|
142
178
|
|
|
143
179
|
try {
|
|
144
180
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_EMAIL_OPTIN, [emailOptIn]);
|
|
@@ -150,7 +186,10 @@ class User {
|
|
|
150
186
|
}
|
|
151
187
|
|
|
152
188
|
setSMSOptin(smsOptIn) {
|
|
153
|
-
if (
|
|
189
|
+
if (Utils.checkParameters([{ type: 'boolean', value: emailOptIn }])) {
|
|
190
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setSMSOptin');
|
|
191
|
+
return this;
|
|
192
|
+
}
|
|
154
193
|
|
|
155
194
|
try {
|
|
156
195
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_SMS_OPTIN, [smsOptIn]);
|
|
@@ -161,7 +200,10 @@ class User {
|
|
|
161
200
|
}
|
|
162
201
|
|
|
163
202
|
setPushOptin(pushOptIn) {
|
|
164
|
-
if (
|
|
203
|
+
if (Utils.checkParameters([{ type: 'boolean', value: pushOptIn }])) {
|
|
204
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setPushOptin');
|
|
205
|
+
return this;
|
|
206
|
+
}
|
|
165
207
|
|
|
166
208
|
try {
|
|
167
209
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_PUSH_OPTIN, [pushOptIn]);
|
|
@@ -173,10 +215,13 @@ class User {
|
|
|
173
215
|
}
|
|
174
216
|
|
|
175
217
|
setLocationOptin(locationOptIn) {
|
|
176
|
-
if (
|
|
218
|
+
if (Utils.checkParameters([{ type: 'boolean', value: locationOptIn }])) {
|
|
219
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setLocationOptin');
|
|
220
|
+
return this;
|
|
221
|
+
}
|
|
177
222
|
|
|
178
223
|
try {
|
|
179
|
-
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_LOCATION_OPTIN, [
|
|
224
|
+
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_LOCATION_OPTIN, [locationOptIn]);
|
|
180
225
|
} catch (error) {
|
|
181
226
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
|
|
182
227
|
}
|
|
@@ -185,7 +230,10 @@ class User {
|
|
|
185
230
|
}
|
|
186
231
|
|
|
187
232
|
setWhatsappOptin(whatsappOptin) {
|
|
188
|
-
if (
|
|
233
|
+
if (Utils.checkParameters([{ type: 'boolean', value: whatsappOptin }])) {
|
|
234
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setWhatsappOptin');
|
|
235
|
+
return this;
|
|
236
|
+
}
|
|
189
237
|
|
|
190
238
|
try {
|
|
191
239
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_WHATSAPP_OPTIN, [whatsappOptin]);
|
|
@@ -198,11 +246,13 @@ class User {
|
|
|
198
246
|
|
|
199
247
|
login(identifiers, insiderIDResult) {
|
|
200
248
|
try {
|
|
201
|
-
if (insiderIDResult
|
|
249
|
+
if (!Utils.checkParameters([{ type: 'function', value: insiderIDResult }, { type: 'object', value: identifiers }])) {
|
|
202
250
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.LOGIN, [identifiers, insiderIDResult]).then(id => insiderIDResult(id));
|
|
251
|
+
} else if (!Utils.checkParameters([{ type: 'object', value: identifiers }])) {
|
|
252
|
+
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.LOGIN, [identifiers]);
|
|
253
|
+
} else {
|
|
254
|
+
Utils.showParameterWarningLog(this.constructor.name + '-login');
|
|
203
255
|
}
|
|
204
|
-
|
|
205
|
-
return Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.LOGIN, [identifiers]);
|
|
206
256
|
} catch (error) {
|
|
207
257
|
Utils.asyncExec(InsiderCordovaPlugin, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
|
|
208
258
|
}
|
|
@@ -217,7 +267,10 @@ class User {
|
|
|
217
267
|
}
|
|
218
268
|
|
|
219
269
|
setCustomAttributeWithString(key, value) {
|
|
220
|
-
if (
|
|
270
|
+
if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'string', value: value }])) {
|
|
271
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithString');
|
|
272
|
+
return this;
|
|
273
|
+
}
|
|
221
274
|
|
|
222
275
|
try {
|
|
223
276
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_STRING, [key, value]);
|
|
@@ -229,7 +282,10 @@ class User {
|
|
|
229
282
|
}
|
|
230
283
|
|
|
231
284
|
setCustomAttributeWithInt(key, value) {
|
|
232
|
-
if (
|
|
285
|
+
if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'number', value: value }])) {
|
|
286
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithInt');
|
|
287
|
+
return this;
|
|
288
|
+
}
|
|
233
289
|
|
|
234
290
|
try {
|
|
235
291
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_INT, [key, value]);
|
|
@@ -241,7 +297,10 @@ class User {
|
|
|
241
297
|
}
|
|
242
298
|
|
|
243
299
|
setCustomAttributeWithDouble(key, value) {
|
|
244
|
-
if (
|
|
300
|
+
if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'number', value: value }])) {
|
|
301
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithDouble');
|
|
302
|
+
return this;
|
|
303
|
+
}
|
|
245
304
|
|
|
246
305
|
try {
|
|
247
306
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_DOUBLE, [key, value]);
|
|
@@ -253,7 +312,10 @@ class User {
|
|
|
253
312
|
}
|
|
254
313
|
|
|
255
314
|
setCustomAttributeWithBoolean(key, value) {
|
|
256
|
-
if (
|
|
315
|
+
if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'boolean', value: value }])) {
|
|
316
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithBoolean');
|
|
317
|
+
return this;
|
|
318
|
+
}
|
|
257
319
|
|
|
258
320
|
try {
|
|
259
321
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_BOOLEAN, [key, value]);
|
|
@@ -265,7 +327,10 @@ class User {
|
|
|
265
327
|
}
|
|
266
328
|
|
|
267
329
|
setCustomAttributeWithDate(key, value) {
|
|
268
|
-
if (
|
|
330
|
+
if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'object', value: value }])) {
|
|
331
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithDate');
|
|
332
|
+
return this;
|
|
333
|
+
}
|
|
269
334
|
|
|
270
335
|
try {
|
|
271
336
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_DATE, [key, value.toISOString()]);
|
|
@@ -277,7 +342,10 @@ class User {
|
|
|
277
342
|
}
|
|
278
343
|
|
|
279
344
|
setCustomAttributeWithArray(key, value) {
|
|
280
|
-
if (
|
|
345
|
+
if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'object', value: value }])) {
|
|
346
|
+
Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithArray');
|
|
347
|
+
return this;
|
|
348
|
+
}
|
|
281
349
|
|
|
282
350
|
try {
|
|
283
351
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_CUSTOM_ATTRIBUTE_WITH_ARRAY, [key, value]);
|
|
@@ -289,7 +357,11 @@ class User {
|
|
|
289
357
|
}
|
|
290
358
|
|
|
291
359
|
unsetCustomAttribute(key) {
|
|
292
|
-
if (
|
|
360
|
+
if (Utils.checkParameters([{ type: 'string', value: key }])) {
|
|
361
|
+
Utils.showParameterWarningLog(this.constructor.name + '-unsetCustomAttribute');
|
|
362
|
+
return this;
|
|
363
|
+
}
|
|
364
|
+
|
|
293
365
|
try {
|
|
294
366
|
Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.UNSET_CUSTOM_ATTRIBUTE, [key]);
|
|
295
367
|
} catch (error) {
|
package/www/Utils.js
CHANGED
|
@@ -7,12 +7,14 @@ module.exports = {
|
|
|
7
7
|
});
|
|
8
8
|
},
|
|
9
9
|
generateJSONErrorString: (error) => {
|
|
10
|
-
return ('[
|
|
10
|
+
return ('[InsiderCordova][JavaScriptError] ' + error);
|
|
11
11
|
},
|
|
12
|
-
|
|
13
|
-
return (
|
|
12
|
+
checkParameters(parameters) {
|
|
13
|
+
return parameters.some((parameterConfig) => {
|
|
14
|
+
return parameterConfig.type !== typeof parameterConfig.value;
|
|
15
|
+
});
|
|
14
16
|
},
|
|
15
|
-
|
|
16
|
-
console.
|
|
17
|
+
showParameterWarningLog(functionName) {
|
|
18
|
+
console.warn("[InsiderCordova] paramaters is not valid, function: " + functionName);
|
|
17
19
|
}
|
|
18
20
|
};
|
package/.github/CODEOWNERS
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# This is a comment.
|
|
2
|
-
# Each line is a file pattern followed by one or more owners.
|
|
3
|
-
|
|
4
|
-
# These owners will be the default owners for everything in
|
|
5
|
-
# the repo. Unless a later match takes precedence,
|
|
6
|
-
# @global-owner1 and @global-owner2 will be requested for
|
|
7
|
-
# review when someone opens a pull request.
|
|
8
|
-
* @melih-useinsider
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
name: gitleaks
|
|
2
|
-
on: [push]
|
|
3
|
-
env:
|
|
4
|
-
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
|
|
5
|
-
|
|
6
|
-
jobs:
|
|
7
|
-
gitleaks:
|
|
8
|
-
runs-on: self-runner-node
|
|
9
|
-
steps:
|
|
10
|
-
- name: Checkout Repository
|
|
11
|
-
uses: actions/checkout@v2
|
|
12
|
-
with:
|
|
13
|
-
fetch-depth: '2'
|
|
14
|
-
- name: Clone GitLeak Action
|
|
15
|
-
uses: actions/checkout@v2
|
|
16
|
-
with:
|
|
17
|
-
repository: useinsider/gitleaks-action
|
|
18
|
-
ref: master
|
|
19
|
-
token: ${{ secrets.PAT }}
|
|
20
|
-
path: .github/actions/gitleaks-action
|
|
21
|
-
- name: Install Dependencies
|
|
22
|
-
run: npm install
|
|
23
|
-
working-directory: .github/actions/gitleaks-action
|
|
24
|
-
- name: gitleaks-action
|
|
25
|
-
uses: ./.github/actions/gitleaks-action
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
name: Cordova Insider Release
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
inputs:
|
|
6
|
-
version_name:
|
|
7
|
-
required: true
|
|
8
|
-
description: The new version name of the SDK to be released (1.0.0)
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
release:
|
|
12
|
-
if: github.actor == 'sonerdm' || github.actor == 'melih-useinsider'
|
|
13
|
-
name: Create Release
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
|
|
16
|
-
steps:
|
|
17
|
-
- name: Checkout code
|
|
18
|
-
uses: actions/checkout@v3
|
|
19
|
-
with:
|
|
20
|
-
ref: develop
|
|
21
|
-
|
|
22
|
-
- name: Publish Cordova SDK
|
|
23
|
-
uses: actions/setup-node@v3.2.0
|
|
24
|
-
with:
|
|
25
|
-
node-version: 12
|
|
26
|
-
registry-url: https://registry.npmjs.org/
|
|
27
|
-
run: |
|
|
28
|
-
npm ci
|
|
29
|
-
npm test
|
|
30
|
-
npm publish
|
|
31
|
-
text=":iphone: Cordova SDK is published with version: ${{ github.event.inputs.version_name }}"
|
|
32
|
-
./slack_notifier.sh mob-deployment mob-sdk-releaser "$text"
|
|
33
|
-
env:
|
|
34
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
35
|
-
SLACK_NOTIFIER_AUTH_KEY: ${{ secrets.SLACK_NOTIFIER_AUTH_KEY }}
|
|
36
|
-
|
|
37
|
-
release-nh:
|
|
38
|
-
needs: release
|
|
39
|
-
name: Create NH Release
|
|
40
|
-
runs-on: ubuntu-latest
|
|
41
|
-
|
|
42
|
-
steps:
|
|
43
|
-
- name: Checkout code
|
|
44
|
-
uses: actions/checkout@v3
|
|
45
|
-
with:
|
|
46
|
-
ref: develop-nh
|
|
47
|
-
|
|
48
|
-
- name: Publish Cordova SDK
|
|
49
|
-
uses: actions/setup-node@v3.2.0
|
|
50
|
-
with:
|
|
51
|
-
node-version: 12
|
|
52
|
-
registry-url: https://registry.npmjs.org/
|
|
53
|
-
run: |
|
|
54
|
-
npm ci
|
|
55
|
-
npm test
|
|
56
|
-
npm publish
|
|
57
|
-
text=":iphone: Cordova NH SDK is published with version: ${{ github.event.inputs.version_name }}-nh"
|
|
58
|
-
./slack_notifier.sh mob-deployment mob-sdk-releaser "$text"
|
|
59
|
-
env:
|
|
60
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
61
|
-
SLACK_NOTIFIER_AUTH_KEY: ${{ secrets.SLACK_NOTIFIER_AUTH_KEY }}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
name: Release Task Merger
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
inputs:
|
|
6
|
-
version_name:
|
|
7
|
-
required: true
|
|
8
|
-
description: The new version name of the SDK to be released (1.0.0)
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
sdk_releaser:
|
|
12
|
-
if: github.actor == 'sonerdm' || github.actor == 'MahammadMD' || github.actor == 'melih-useinsider'
|
|
13
|
-
name: Trigger mobile-devops repository task merger
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
steps:
|
|
16
|
-
- name: Repository Dispatch
|
|
17
|
-
uses: peter-evans/repository-dispatch@v1
|
|
18
|
-
with:
|
|
19
|
-
token: ${{ secrets.GIT_TOKEN }}
|
|
20
|
-
repository: useinsider/mobile-devops
|
|
21
|
-
event-type: sdk-release-module
|
|
22
|
-
client-payload: '{"repo-name": "insider-cordova-SDK", "sdk_version_name": "${{ github.event.inputs.version_name }}"}'
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
name: Release Version Setter
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
repository_dispatch:
|
|
5
|
-
types: [trigger-release-version-setter]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
release_version_setter:
|
|
9
|
-
name: Run Version Setter
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- name: Checkout code
|
|
13
|
-
uses: actions/checkout@v3
|
|
14
|
-
with:
|
|
15
|
-
ref: develop
|
|
16
|
-
|
|
17
|
-
- name: Configure AWS credentials
|
|
18
|
-
uses: aws-actions/configure-aws-credentials@v1
|
|
19
|
-
with:
|
|
20
|
-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
21
|
-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
22
|
-
aws-region: eu-west-1
|
|
23
|
-
|
|
24
|
-
- name: Run release_version.sh
|
|
25
|
-
run: |
|
|
26
|
-
./release_version.sh ${{ github.event.client_payload.sdk_version_name }}
|
|
27
|
-
|
|
28
|
-
- name: Push changes to develop
|
|
29
|
-
run: |
|
|
30
|
-
git config --global user.name 'sonerdm'
|
|
31
|
-
git config --global user.email 'soner@useinsider.com'
|
|
32
|
-
git remote set-url origin https://x-access-token:${{ secrets.GIT_TOKEN }}@github.com/${{ github.repository }}
|
|
33
|
-
git commit -am "Release version ${{ github.event.client_payload.sdk_version_name }}"
|
|
34
|
-
git push
|
|
35
|
-
env:
|
|
36
|
-
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
|
|
37
|
-
|
|
38
|
-
- name: Notify QAs
|
|
39
|
-
run: |
|
|
40
|
-
text=":tatakae: Cordova SDK is ready to test with version: ${{ github.event.client_payload.sdk_version_name }} <!subteam^SUUGFQNVA|mobileqa>"
|
|
41
|
-
./slack_notifier.sh mob-deployment mob-sdk-releaser "$text"
|
|
42
|
-
env:
|
|
43
|
-
SLACK_NOTIFIER_AUTH_KEY: ${{ secrets.SLACK_NOTIFIER_AUTH_KEY }}
|
package/release_version.sh
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
NEW_CV_VERSION_NAME=$1
|
|
4
|
-
|
|
5
|
-
packagejson_file_path="package.json"
|
|
6
|
-
gradle_file_path="src/android/build-extras.gradle"
|
|
7
|
-
|
|
8
|
-
CURRENT_CV_SDK_VERSION=$(sed -n 3p $packagejson_file_path | cut -d '"' -f 4)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
CURRENT_ANDROID_VERSION=$(sed -n 22p $gradle_file_path | awk '{print $2}' | awk -F : '{print $3}' | cut -d "'" -f 1)
|
|
12
|
-
CURRENT_ANDROID_HYBRID_VERSION=$(sed -n 23p $gradle_file_path | awk '{print $2}' | awk -F : '{print $3}' | cut -d "'" -f 1)
|
|
13
|
-
|
|
14
|
-
LATEST_iOS_VERSION=$(aws s3 ls s3://mobilesdk.useinsider.com/iOS/ --recursive | sort | tail -n 1 | awk '{print $4}' | awk -F / '{print $2}')
|
|
15
|
-
LATEST_iOS_HYBRID_VERSION=$(aws s3 ls s3://mobilesdk.useinsider.com/iOSHybrid/ --recursive | sort | tail -n 1 | awk '{print $4}' | awk -F / '{print $2}')
|
|
16
|
-
|
|
17
|
-
LATEST_ANDROID_VERSION=$(aws s3 ls s3://mobilesdk.useinsider.com/android/com/useinsider/insider/ --recursive | sort | tail -n 1 | awk '{print $4}' | awk -F / '{print $5}' | cut -d "-" -f 1)
|
|
18
|
-
LATEST_ANDROID_HYBRID_VERSION=$(aws s3 ls s3://mobilesdk.useinsider.com/android/com/useinsider/insiderhybrid/ --recursive | sort | tail -n 1 | awk '{print $4}' | awk -F / '{print $5}')
|
|
19
|
-
|
|
20
|
-
# # Set new version in package.json
|
|
21
|
-
# sed -i "s/$CURRENT_CV_SDK_VERSION/$NEW_CV_VERSION_NAME/" $packagejson_file_path
|
|
22
|
-
|
|
23
|
-
# # Set new version in podspec
|
|
24
|
-
# sed -i "s/$CURRENT_iOS_VERSION/$LATEST_iOS_VERSION/;s/$CURRENT_iOS_HYBRID_VERSION/$LATEST_iOS_HYBRID_VERSION/" $podspec_file_path
|
|
25
|
-
|
|
26
|
-
# # Set new version in build.gradle
|
|
27
|
-
# sed -i "s/$CURRENT_ANDROID_VERSION/$LATEST_ANDROID_VERSION/;s/$CURRENT_ANDROID_HYBRID_VERSION/$LATEST_ANDROID_HYBRID_VERSION/" $gradle_file_path
|
package/slack_notifier.sh
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
SLACK_ENDPOINT="https://mobile.useinsider.com/api/lilith/slack_notifier"
|
|
3
|
-
|
|
4
|
-
CHANNEL=$1
|
|
5
|
-
USERNAME=$2
|
|
6
|
-
TEXT="$3"
|
|
7
|
-
|
|
8
|
-
generate_post_data()
|
|
9
|
-
{
|
|
10
|
-
cat <<EOF
|
|
11
|
-
{
|
|
12
|
-
"channel": "$CHANNEL",
|
|
13
|
-
"message": "$TEXT",
|
|
14
|
-
"username": "$USERNAME",
|
|
15
|
-
"auth_key": "$SLACK_NOTIFIER_AUTH_KEY"
|
|
16
|
-
}
|
|
17
|
-
EOF
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
curl -i -H "Content-Type:application/json" -X POST --data "$(generate_post_data)" $SLACK_ENDPOINT >/dev/null 2>&1
|