Skip to content

Commit 815e8b5

Browse files
committed
feat: automate cadence release data onto documentation
1 parent 3e0b66a commit 815e8b5

File tree

15 files changed

+306
-12
lines changed

15 files changed

+306
-12
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ $ GIT_USER=<Your GitHub username> npm run deploy
6262
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
6363

6464

65+
### Updating Release Data
66+
67+
The release pages rely on data from GitHub that is persisted as json files under `static/data/releases/`.
68+
In order to update the release information for display, this can be done manually or be set up as part of the CI/CD process by running the `scripts/fetch-releases.sh` script. Script uses the [GitHub CLI](https://cli.github.com/) to fetch the release data.
69+
6570
# NPM Registry
6671

6772
Ensure you have a `.npmrc` [file](https://docs.npmjs.com/cli/v9/configuring-npm/npmrc/) configured with `registry=https://registry.npmjs.org/`.

docs/09-releases/cadence.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
layout: default
3+
title: Cadence Service Releases
4+
description: Release Notes
5+
permalink: /docs/releases
6+
---
7+
8+
import {
9+
ListReleases,
10+
getReleaseData,
11+
getLatestRelease,
12+
} from "@site/src/components/CadenceReleases";
13+
14+
export const releases = getReleaseData("cadence.json");
15+
export const latestRelease = getLatestRelease(releases);
16+
17+
Cadence follows [semantic versioning](https://semver.org/spec/v2.0.0.html) and you can find more information about changes between version on the Cadence [changelog](https://github.com/cadence-workflow/cadence/blob/master/CHANGELOG.md).
18+
19+
:::tip[Latest release for General Availability]
20+
21+
<a href={latestRelease.html_url} target="_blank">{latestRelease.name} ({latestRelease.tag_name}) </a> published on {latestRelease.published_at_date}
22+
23+
:::
24+
25+
<ListReleases releases={releases}></ListReleases>
26+
27+
---
28+
29+
For a comprehensive list of changes and detailed release notes, please visit the [Cadence GitHub Releases page](https://github.com/cadence-workflow/cadence/releases).

docs/09-releases/go-client.mdx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
layout: default
3+
title: Cadence Go Client Releases
4+
description: Release Notes
5+
permalink: /docs/releases/go-client
6+
---
7+
8+
# Cadence Go Client
9+
10+
import {ListReleases, getReleaseData, getLatestRelease} from '@site/src/components/CadenceReleases';
11+
export const releases = getReleaseData('cadence-go-client.json');
12+
export const latestRelease = getLatestRelease(releases);
13+
14+
15+
Cadence follows [semantic versioning](https://semver.org/spec/v2.0.0.html) and you can find more information about changes between version on the Cadence [changelog](https://github.com/cadence-workflow/cadence/blob/master/CHANGELOG.md).
16+
17+
:::tip[Latest release for General Availability]
18+
19+
<a href={latestRelease.html_url} target="_blank">{latestRelease.name} ({latestRelease.tag_name})</a> published on {latestRelease.published_at_date}
20+
21+
:::
22+
23+
<ListReleases releases={releases}></ListReleases>
24+
25+
---
26+
27+
For a comprehensive list of changes and detailed release notes, please visit the [Cadence GitHub Releases page](https://github.com/cadence-workflow/cadence/releases).

docs/09-releases/java-client.mdx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
layout: default
3+
title: Cadence Java Client Releases
4+
description: Release Notes
5+
permalink: /docs/releases/java-client
6+
---
7+
8+
# Cadence Java Client
9+
10+
import {ListReleases, getReleaseData, getLatestRelease} from '@site/src/components/CadenceReleases';
11+
export const releases = getReleaseData('cadence-java-client.json');
12+
export const latestRelease = getLatestRelease(releases);
13+
14+
15+
Cadence follows [semantic versioning](https://semver.org/spec/v2.0.0.html) and you can find more information about changes between version on the Cadence [changelog](https://github.com/cadence-workflow/cadence/blob/master/CHANGELOG.md).
16+
17+
:::tip[Latest release for General Availability]
18+
19+
<a href={latestRelease.html_url} target="_blank">{latestRelease.name} ({latestRelease.tag_name})</a> published on {latestRelease.published_at_date}
20+
21+
:::
22+
23+
<ListReleases releases={releases}></ListReleases>
24+
25+
---
26+
27+
For a comprehensive list of changes and detailed release notes, please visit the [Cadence GitHub Releases page](https://github.com/cadence-workflow/cadence/releases).
File renamed without changes.
File renamed without changes.

package-lock.json

Lines changed: 86 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cadence",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"private": true,
55
"scripts": {
66
"docusaurus": "docusaurus",
@@ -26,18 +26,22 @@
2626
"@docusaurus/preset-classic": "^3.7.0",
2727
"@docusaurus/remark-plugin-npm2yarn": "^3.7.0",
2828
"@docusaurus/theme-search-algolia": "^3.7.0",
29+
"@iconify/react": "^5.2.0",
2930
"@mdx-js/react": "^3.0.0",
3031
"@pnpm/config.env-replace": "^3.0.0",
3132
"clsx": "^2.0.0",
33+
"lodash": "^4.17.21",
3234
"prism-react-renderer": "^2.3.0",
3335
"react": "^18.0.0",
3436
"react-dom": "^18.0.0",
37+
"react-markdown": "^9.0.3",
3538
"remark-math": "^6.0.0"
3639
},
3740
"devDependencies": {
3841
"@docusaurus/module-type-aliases": "^3.7.0",
3942
"@docusaurus/tsconfig": "^3.7.0",
4043
"@docusaurus/types": "^3.7.0",
44+
"@types/lodash": "^4.17.15",
4145
"typescript": "~5.6.2"
4246
},
4347
"browserslist": {

scripts/fetch-releases.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# This script downloads the latests release data from cadence-workflow repositories
3+
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
8+
9+
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

sidebars.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ const sidebars: SidebarsConfig = {
143143
{ type: 'doc', id: 'workflow-troubleshooting/retries' },
144144
],
145145
},
146+
{
147+
label: 'Releases',
148+
type: 'category',
149+
items: [
150+
{ type: 'doc', 'id': 'releases/cadence', label: 'Cadence Service' },
151+
{ type: 'doc', 'id': 'releases/go-client', label: 'Cadence Go Client' },
152+
{ type: 'doc', 'id': 'releases/java-client', label: 'Cadence Java Client' },
153+
],
154+
},
146155
{
147156
label: 'About',
148157
type: 'category',

0 commit comments

Comments
 (0)