Skip to content

Commit

Permalink
chore: switch changelog to markdown (#853)
Browse files Browse the repository at this point in the history
* creating CHANGELOG.md

* edits to index and changelog

* chore: changing output directory to avoid use absolute paths

* update to changelog script and contributing guide

* dfx.json

* removes empty first line

* reformatting using conventions from keepachangelog.com

* updating roll-changelog script
  • Loading branch information
krpeacock authored Feb 22, 2024
1 parent e04e3c6 commit 3502217
Show file tree
Hide file tree
Showing 17 changed files with 4,742 additions and 2,059 deletions.
24 changes: 13 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,16 @@ dist
.vscode

# Generated Docs
docs/generated/agent
docs/generated/assets
docs/generated/auth-client
docs/generated/authentication
docs/generated/identity
docs/generated/identity-secp256k1
docs/generated/identity-ledgerhq
docs/generated/principal
docs/generated/candid
docs/generated/bls-verify
docs/generated/identity-secp256k1
docs/agent
docs/assets
docs/auth-client
docs/authentication
docs/identity
docs/identity-secp256k1
docs/identity-ledgerhq
docs/principal
docs/candid
docs/bls-verify
docs/identity-secp256k1
docs/generated
docs/changelog.html
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ additional detail if necessary

This will automatically link your commit to the GitHub issue, and automatically close it when the pull request is merged.

Please document your changes in the [changelog.html](./docs/generated/changelog.html) file.
Please document your changes in the [CHANGELOG.md](./docs/CHANGELOG.md) file.

## Formatting

Expand Down Expand Up @@ -104,7 +104,7 @@ Start the process by initiating the GitHub Action Workflow `prepare-release.yml`
The `prepare-release.yml` GitHub Actions workflow checks out the code, sets up Node.js, installs dependencies, and runs the release script via `release-it`. The process, defined in our `package.json` file, includes the following tasks:

- version bump,
- roll version in CHANGELOG.md,
- roll version in [CHANGELOG.md](./docs/CHANGELOG.md),
- new release branch creation,
- git tag creation and push,
- suitable GitHub Release summary creation based on commit history,
Expand Down
12 changes: 7 additions & 5 deletions bin/roll-changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ if (!newVersion) {
console.error('Please provide a new version as an argument.');
process.exit(1);
}
const now = new Date();
const formattedDate = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`;

const path: string = 'docs/generated/changelog.html';
const pattern: string = ' <h2>Version x.x.x</h2>';
const replacement: string = ` <h2>Version x.x.x</h2>
<ul></ul>
<h2>Version ${newVersion}</h2>`;
const path: string = 'docs/CHANGELOG.md';
const pattern: string = '## [Unreleased]';
const replacement: string = `## [Unreleased]
## [${newVersion}] - ${formattedDate}`;

readFile(path, 'utf8', (err, data) => {
if (err) throw err;
Expand Down
4 changes: 3 additions & 1 deletion dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"canisters": {
"docs": {
"type": "assets",
"source": ["docs/generated"]
"source": [
"docs"
]
},
"counter": {
"type": "motoko",
Expand Down
Loading

0 comments on commit 3502217

Please sign in to comment.