Skip to content

Commit c753e1d

Browse files
committed
Replace changelog script and updated library versions
1 parent 730f9d6 commit c753e1d

10 files changed

+762
-120
lines changed

scripts/changelog.js

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
const axios = require('axios');
2+
const path = require('path');
3+
const fs = require('fs');
4+
const fm = require('front-matter');
5+
const yaml = require('js-yaml');
6+
7+
API_URL = "https://api.github.com/repos/segmentio/"
8+
9+
const getLog = async (url = "") => {
10+
try {
11+
const res = await axios.get(url, {
12+
headers: {
13+
'Content-Type': 'application/json',
14+
}
15+
});
16+
return res.data
17+
} catch (error) {
18+
console.log(error)
19+
}
20+
}
21+
let libraries = ["analytics-android","analytics-ios", "analytics-react-native", "analytics-node", "analytics-python", "analytics-php", "analytics-go", "analytics-java", "analytics.NET"]
22+
23+
const replace_token = /.+\r\n(-{2,}\r\n)|.+\r\n(={2,}\r\n)/mg;
24+
const subst = ``
25+
26+
const updateLog = async(library) => {
27+
28+
let releasesUpdated = []
29+
let url = API_URL+library+'/releases'
30+
const releases = await getLog(url)
31+
releases.forEach(release => {
32+
let note = release.body
33+
cleaned_note = note.replace(replace_token,subst)
34+
let updatedRelease = {
35+
version: release.name,
36+
url: release.html_url,
37+
date: release.published_at,
38+
notes: cleaned_note
39+
}
40+
releasesUpdated.push(updatedRelease)
41+
})
42+
43+
const options = { noArrayIndent: true };
44+
var todayDate = new Date().toISOString().slice(0,10);
45+
output = "# AUTOGENERATED FROM GITHUB API. DO NOT EDIT\n"
46+
output += "# Releases last updated " + todayDate + " \n";
47+
output += yaml.dump({ releases: releasesUpdated }, options);
48+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/changelogs/${library}.yml`), output);
49+
}
50+
51+
libraries.forEach(library => {
52+
updateLog(library);
53+
});

src/_data/changelogs/analytics-android.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
# AUTOGENERATED FROM GITHUB API. DO NOT EDIT
2-
# Releases last updated 2022-06-14
2+
# Releases last updated 2023-09-27
33
releases:
4+
- version: 4.11.3
5+
url: https://github.com/segmentio/analytics-android/releases/tag/4.11.3
6+
date: '2023-05-17T17:58:47Z'
7+
notes: "## What's Changed\r\n* prepare release 4.11.2 by @wenxi-zeng in https://github.com/segmentio/analytics-android/pull/834\r\n* fix DisplayMetrics crashes on android 11+ (crashes introduced by previous release 4.11.2) by @wenxi-zeng in https://github.com/segmentio/analytics-android/pull/836\r\n\r\n\r\n**Full Changelog**: https://github.com/segmentio/analytics-android/compare/4.11.2...4.11.3"
8+
- version: 4.11.2
9+
url: https://github.com/segmentio/analytics-android/releases/tag/4.11.2
10+
date: '2023-05-16T16:46:40Z'
11+
notes: "## What's Changed\r\n* prepare release 4.11.1 by @wenxi-zeng in https://github.com/segmentio/analytics-android/pull/825\r\n* fix WindowManager crash on android 11+ by @wenxi-zeng in https://github.com/segmentio/analytics-android/pull/832\r\n\r\n\r\n**Full Changelog**: https://github.com/segmentio/analytics-android/compare/4.11.1...4.11.2"
12+
- version: 4.11.1
13+
url: https://github.com/segmentio/analytics-android/releases/tag/4.11.1
14+
date: '2023-03-14T16:06:18Z'
15+
notes: "## What's Changed\r\n* release 4.11.0 by @wenxi-zeng in https://github.com/segmentio/analytics-android/pull/822\r\n* fix androidx lifecycle causes analytics init in background crash by @wenxi-zeng in https://github.com/segmentio/analytics-android/pull/824\r\n\r\n\r\n**Full Changelog**: https://github.com/segmentio/analytics-android/compare/4.11.0...4.11.1"
16+
- version: 4.11.0
17+
url: https://github.com/segmentio/analytics-android/releases/tag/4.11.0
18+
date: '2023-01-06T20:19:16Z'
19+
notes: "* [New](https://github.com/segmentio/analytics-android/pull/817): move writeKey from http request header to payload body\r\n"
420
- version: 4.10.4
521
url: https://github.com/segmentio/analytics-android/releases/tag/4.10.4
622
date: '2022-02-18T00:41:47Z'

src/_data/changelogs/analytics-go.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTOGENERATED FROM GITHUB API. DO NOT EDIT
2-
# Releases last updated 2022-06-14
2+
# Releases last updated 2023-09-27
33
releases:
44
- version: Fix vendor packages
55
url: https://github.com/segmentio/analytics-go/releases/tag/v3.0.1

src/_data/changelogs/analytics-ios.yml

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# AUTOGENERATED FROM GITHUB API. DO NOT EDIT
2-
# Releases last updated 2022-06-14
2+
# Releases last updated 2023-09-27
33
releases:
4+
- version: 4.1.8
5+
url: https://github.com/segmentio/analytics-ios/releases/tag/4.1.8
6+
date: '2023-02-01T22:35:55Z'
7+
notes: "* [Fix](https://github.com/segmentio/analytics-ios/pull/1052) Fix null setting entry crash on tvOS\r\n"
8+
- version: 4.1.7
9+
url: https://github.com/segmentio/analytics-ios/releases/tag/4.1.7
10+
date: '2023-01-06T20:49:56Z'
11+
notes: >-
12+
* [Fix](https://github.com/segmentio/analytics-ios/pull/1049) Removed
13+
writekey from request header; Added context.instanceId.
414
- version: 4.1.6
515
url: https://github.com/segmentio/analytics-ios/releases/tag/4.1.6
616
date: '2021-10-05T15:53:37Z'
@@ -113,11 +123,3 @@ releases:
113123
url: https://github.com/segmentio/analytics-ios/releases/tag/3.6.10-beta
114124
date: '2018-11-15T21:40:18Z'
115125
notes: "* [Fix](https://github.com/segmentio/analytics-ios/pull/798): Add deep links redaction\r\n"
116-
- version: Version 3.7.0-beta.1
117-
url: https://github.com/segmentio/analytics-ios/releases/tag/3.7.0-beta.1
118-
date: '2018-10-23T20:57:08Z'
119-
notes: "\r\n* [Fix](https://github.com/segmentio/analytics-ios/pull/795): Remove -beta suffix from CFBundleShortVersionString\r\n"
120-
- version: Version 3.7.0-beta
121-
url: https://github.com/segmentio/analytics-ios/releases/tag/3.7.0-beta
122-
date: '2018-08-27T18:07:09Z'
123-
notes: "* [Improvement](https://github.com/segmentio/analytics-ios/pull/765): Make the maximum queue size configurable\r\n* [Improvement](https://github.com/segmentio/analytics-ios/pull/767): Make the flush interval configurable\r\n\r\n* [Fix](https://github.com/segmentio/analytics-ios/pull/773): Fix linking issues when automatic framework linking is disabled\r\n* [Fix](https://github.com/segmentio/analytics-ios/pull/763): Retry HTTP 429 status codes\r\n* [Fix](https://github.com/segmentio/analytics-ios/pull/761): Send RFC 7231 Formatted User Agent\r\n* [Fix](https://github.com/segmentio/analytics-ios/pull/751): Ensure queue is always < 1000 items\r\n* [Fix](https://github.com/segmentio/analytics-ios/pull/750): Reset SEGUserIdKey only on tvOS\r\n* [Fix](https://github.com/segmentio/analytics-ios/pull/749): Renames GZIP category to prevent collisions\r\n* [Fix](https://github.com/segmentio/analytics-ios/pull/744): sharedAnalytics returns null before setup\r\n* [Fix](https://github.com/segmentio/analytics-ios/pull/741): Swift 4 support"
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# AUTOGENERATED FROM GITHUB API. DO NOT EDIT
2-
# Releases last updated 2022-06-14
2+
# Releases last updated 2023-09-27
33
releases: []

src/_data/changelogs/analytics-node.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# AUTOGENERATED FROM GITHUB API. DO NOT EDIT
2-
# Releases last updated 2022-06-14
2+
# Releases last updated 2023-09-27
33
releases:
4+
- version: ''
5+
url: https://github.com/segmentio/analytics-node/releases/tag/v6.2.0
6+
date: '2022-08-02T18:00:16Z'
7+
notes: "- Ensure callback is called when envoking errorHanlder 58b79b4\r\n\r\nhttps://github.com/segmentio/analytics-node/compare/v6.1.0...v6.2.0"
8+
- version: ''
9+
url: https://github.com/segmentio/analytics-node/releases/tag/v6.1.0
10+
date: '2022-07-13T18:52:47Z'
11+
notes: "- See [this](https://github.com/segmentio/analytics-node/blob/master/History.md#v610--2022-07-13) for changelog \r\n\r\nhttps://github.com/segmentio/analytics-node/compare/v6.0.0...v6.1.0"
412
- version: ''
513
url: https://github.com/segmentio/analytics-node/releases/tag/v6.0.0
614
date: '2021-11-19T18:35:39Z'

src/_data/changelogs/analytics-php.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# AUTOGENERATED FROM GITHUB API. DO NOT EDIT
2-
# Releases last updated 2022-06-14
2+
# Releases last updated 2023-09-27
33
releases:
4+
- version: 3.7.0
5+
url: https://github.com/segmentio/analytics-php/releases/tag/3.7.0
6+
date: '2023-09-11T13:53:19Z'
7+
notes: >-
8+
Changelog available
9+
[here](https://github.com/segmentio/analytics-php/blob/master/HISTORY.md#370--2023-09-11)
10+
- version: 3.6.0
11+
url: https://github.com/segmentio/analytics-php/releases/tag/3.6.0
12+
date: '2023-03-28T17:34:17Z'
13+
notes: >-
14+
Changelog available
15+
[here](https://github.com/segmentio/analytics-php/blob/master/HISTORY.md#360--2023-03-28)
416
- version: 2.0.0
517
url: https://github.com/segmentio/analytics-php/releases/tag/2.0.0
618
date: '2021-07-21T17:36:37Z'
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# AUTOGENERATED FROM GITHUB API. DO NOT EDIT
2-
# Releases last updated 2022-06-14
2+
# Releases last updated 2023-09-27
33
releases: []

0 commit comments

Comments
 (0)