Skip to content

Commit cf19517

Browse files
committed
fix: don't tag RC as latest release for GA
1 parent 37d7f53 commit cf19517

File tree

8 files changed

+3776
-30
lines changed

8 files changed

+3776
-30
lines changed

docs/09-releases/cadence.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ Cadence follows [semantic versioning](https://semver.org/spec/v2.0.0.html) and y
1818

1919
:::tip[Latest release for General Availability]
2020

21-
<a href={latestRelease.html_url} target="_blank">{latestRelease.name} ({latestRelease.tag_name}) </a> published on {latestRelease.published_at_date}
21+
> <strong><a href={latestRelease.html_url} target="_blank">{latestRelease.name}</a> </strong>published on {latestRelease.published_at_date}
2222
2323
:::
2424

25+
## Major Releases
2526
<ListReleases releases={releases}></ListReleases>
2627

2728
---

docs/09-releases/go-client.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ Cadence follows [semantic versioning](https://semver.org/spec/v2.0.0.html) and y
1616

1717
:::tip[Latest release for General Availability]
1818

19-
<a href={latestRelease.html_url} target="_blank">{latestRelease.name} ({latestRelease.tag_name})</a> published on {latestRelease.published_at_date}
19+
> <strong><a href={latestRelease.html_url} target="_blank">{latestRelease.name}</a> </strong>published on {latestRelease.published_at_date}
2020
2121
:::
2222

23+
## Major Releases
2324
<ListReleases releases={releases}></ListReleases>
2425

2526
---

docs/09-releases/java-client.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ Cadence follows [semantic versioning](https://semver.org/spec/v2.0.0.html) and y
1616

1717
:::tip[Latest release for General Availability]
1818

19-
<a href={latestRelease.html_url} target="_blank">{latestRelease.name} ({latestRelease.tag_name})</a> published on {latestRelease.published_at_date}
19+
> <strong><a href={latestRelease.html_url} target="_blank">{latestRelease.name}</a> </strong>published on {latestRelease.published_at_date}
2020
2121
:::
2222

23+
## Major Releases
2324
<ListReleases releases={releases}></ListReleases>
2425

2526
---

scripts/fetch-releases.sh

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
11
#!/bin/bash
22

3-
# This script downloads the latests release data from cadence-workflow repositories
4-
gh api \
5-
-H "Accept: application/vnd.github+json" \
6-
-H "X-GitHub-Api-Version: 2022-11-28" \
7-
/repos/cadence-workflow/cadence/releases > static/data/releases/cadence.json
3+
# Define repositories and corresponding output paths using parallel arrays
4+
repos=("cadence" "cadence-go-client" "cadence-java-client")
5+
files=("static/data/releases/cadence.json" "static/data/releases/cadence-go-client.json" "static/data/releases/cadence-java-client.json")
86

7+
# Fetch latest release data, skip release assets
8+
for i in "${!repos[@]}"; do
9+
gh api -H "Accept: application/vnd.github+json" \
10+
-H "X-GitHub-Api-Version: 2022-11-28" \
11+
"/repos/cadence-workflow/${repos[$i]}/releases" | jq 'del(.[].assets)' > "${files[$i]}"
12+
done
913

10-
gh api \
11-
-H "Accept: application/vnd.github+json" \
12-
-H "X-GitHub-Api-Version: 2022-11-28" \
13-
/repos/cadence-workflow/cadence-go-client/releases > static/data/releases/cadence-go-client.json
14-
15-
16-
gh api \
17-
-H "Accept: application/vnd.github+json" \
18-
-H "X-GitHub-Api-Version: 2022-11-28" \
19-
/repos/cadence-workflow/cadence-java-client/releases > static/data/releases/cadence-java-client.json
20-
21-
# Validate json files, if any of the commands fail, the script will exit with a non-zero status
22-
cat static/data/releases/cadence.json | jq '.[] | has("tag_name") and has("body")' -e > /dev/null
23-
cat static/data/releases/cadence-go-client.json | jq '.[] | has("tag_name") and has("body")' -e > /dev/null
24-
cat static/data/releases/cadence-java-client.json | jq '.[] | has("tag_name") and has("body")' -e > /dev/null
14+
# Validate JSON files
15+
for file in "${files[@]}"; do
16+
jq '.[] | has("tag_name") and has("body")' -e "$file" > /dev/null
17+
done

src/components/CadenceReleases/index.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ export function getReleaseData(source) {
2222
}
2323

2424
export function getLatestRelease(releases) {
25-
return releases[0];
25+
return _.find(
26+
releases,
27+
(release) => release.prerelease === false && release.draft === false
28+
);
2629
}
2730

2831
const getMajorReleases = (releases) => {
@@ -65,9 +68,7 @@ function Releases({ releases }): JSX.Element {
6568
{release.published_at_string}
6669
</Heading>
6770

68-
<Markdown remarkPlugins={[remarkGfm]}>
69-
{release.body}
70-
</Markdown>
71+
<Markdown remarkPlugins={[remarkGfm]}>{release.body}</Markdown>
7172

7273
<br></br>
7374
</div>

static/data/releases/cadence-go-client.json

Lines changed: 1190 additions & 1 deletion
Large diffs are not rendered by default.

static/data/releases/cadence-java-client.json

Lines changed: 1213 additions & 1 deletion
Large diffs are not rendered by default.

static/data/releases/cadence.json

Lines changed: 1349 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)