Skip to content

Commit ef8b55f

Browse files
committed
chore(release): update changelog and readme
- Improved table formatting in README - Removed redundant lines in workflow - Added docstrings to ChangelogService - Updated README table structure - Minor README and workflow cleanup
1 parent 5a5d987 commit ef8b55f

7 files changed

Lines changed: 1499 additions & 538 deletions

File tree

.github/workflows/version-bump.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ on:
1717
- minor
1818
- major
1919

20-
21-
2220
jobs:
2321
bump:
2422
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,4 +320,4 @@ All notable changes for each version of the Ambient Music extension.
320320
- CI: Keep the versions up-to-date.
321321
- Updated.
322322
- Build: Update build script.
323-
- Updated readme.
323+
- Updated readme.

README.md

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ This action will automatically detect the version file and bump the version acco
1414

1515
The action will first try to detect the platform of the project by looking for common version files in the root directory. The following files are supported:
1616

17-
| Platform | Version File |
18-
| --- | --- |
19-
| Docker | `Dockerfile` |
20-
| Go | `go.mod` |
21-
| Node | `package.json` |
22-
| PHP | `composer.json` |
23-
| Python | `pyproject.toml`, `setup.py` |
24-
| Rust | `Cargo.toml` |
17+
| Platform | Version File |
18+
| -------- | ---------------------------- |
19+
| Docker | `Dockerfile` |
20+
| Go | `go.mod` |
21+
| Node | `package.json` |
22+
| PHP | `composer.json` |
23+
| Python | `pyproject.toml`, `setup.py` |
24+
| Rust | `Cargo.toml` |
2525

2626
If a version file is found, the action will bump the version in that file. If no version file is found, the action will fail.
2727

@@ -64,19 +64,19 @@ To explicitly target a platform, use the `target_platform` input:
6464

6565
## Inputs
6666

67-
| Name | Description | Default |
68-
| --- | --- | --- |
69-
| `release_type` | Select the version bump type (patch, minor, major) | `patch` |
70-
| `git_tag` | Whether to create a Git tag after bump | `true` |
71-
| `target_platform` | Explicitly specify the platform to update (e.g., `node`, `python`). If not provided, the platform will be detected automatically. | `''` |
72-
| `target_path` | The target path where the version bump should be applied. If not provided, the action will run in the root directory. | `.` |
67+
| Name | Description | Default |
68+
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------- |
69+
| `release_type` | Select the version bump type (patch, minor, major) | `patch` |
70+
| `git_tag` | Whether to create a Git tag after bump | `true` |
71+
| `target_platform` | Explicitly specify the platform to update (e.g., `node`, `python`). If not provided, the platform will be detected automatically. | `''` |
72+
| `target_path` | The target path where the version bump should be applied. If not provided, the action will run in the root directory. | `.` |
7373

7474
## Outputs
7575

76-
| Name | Description |
77-
| --- | --- |
78-
| `new_version` | The new bumped version |
79-
| `tag` | The created Git tag (if enabled) |
76+
| Name | Description |
77+
| ------------- | -------------------------------- |
78+
| `new_version` | The new bumped version |
79+
| `tag` | The created Git tag (if enabled) |
8080

8181
## Example Workflow
8282

@@ -100,8 +100,6 @@ on:
100100
- minor
101101
- major
102102
103-
104-
105103
jobs:
106104
bump:
107105
runs-on: ubuntu-latest
@@ -118,7 +116,6 @@ jobs:
118116
git_tag: false
119117
env:
120118
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121-
122119
```
123120

124121
## Development
@@ -135,4 +132,4 @@ This project is governed by the [Code of Conduct](CODE_OF_CONDUCT.md).
135132

136133
## License
137134

138-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
135+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

dist/index.js

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Author: Taj <[email protected]>
77
* Homepage: https://github.com/taj54/universal-version-bump#readme
88
* License: MIT
9-
* Generated on Tue, 26 Aug 2025 08:40:56 GMT
9+
* Generated on Tue, 26 Aug 2025 10:10:42 GMT
1010
*/
1111
require('./sourcemap-register.js');/******/ (() => { // webpackBootstrap
1212
/******/ var __webpack_modules__ = ({
@@ -32918,10 +32918,17 @@ var __importStar = (this && this.__importStar) || (function () {
3291832918
Object.defineProperty(exports, "__esModule", ({ value: true }));
3291932919
exports.ChangelogService = void 0;
3292032920
const exec = __importStar(__nccwpck_require__(8872));
32921+
/**
32922+
* Service for managing the changelog file.
32923+
*/
3292132924
class ChangelogService {
3292232925
constructor(fileHandler) {
3292332926
this.fileHandler = fileHandler;
3292432927
}
32928+
/**
32929+
* Get the latest git tag.
32930+
* @returns The latest tag as a string.
32931+
*/
3292532932
async getLatestTag() {
3292632933
let latestTag = '';
3292732934
const options = {
@@ -32934,6 +32941,11 @@ class ChangelogService {
3293432941
await exec.exec('git', ['describe', '--tags', '--abbrev=0'], options);
3293532942
return latestTag.trim();
3293632943
}
32944+
/**
32945+
* Get the commits since a specific tag.
32946+
* @param tag The tag to get commits since.
32947+
* @returns An array of commit messages.
32948+
*/
3293732949
async getCommitsSinceTag(tag) {
3293832950
let commits = '';
3293932951
const options = {
@@ -32946,20 +32958,28 @@ class ChangelogService {
3294632958
await exec.exec('git', ['log', `${tag}..HEAD`, '--oneline'], options);
3294732959
return commits.split('\n').filter(Boolean);
3294832960
}
32961+
/**
32962+
* Generate a changelog from the given commits.
32963+
* @param commits The list of commits to include in the changelog.
32964+
* @param newVersion The new version number.
32965+
* @returns The generated changelog as a string.
32966+
*/
3294932967
generateChangelog(commits, newVersion) {
3295032968
const changelogDate = new Date().toISOString().split('T')[0];
3295132969
let changelogContent = `## v${newVersion} ${changelogDate}\n\n`;
3295232970
const categorizedCommits = { Added: [], Changed: [], Fixed: [] };
3295332971
for (const commit of commits) {
3295432972
const commitMessage = commit.split(' ').slice(1).join(' ');
32973+
const messageParts = commitMessage.split(':');
32974+
const message = messageParts.length > 1 ? messageParts.slice(1).join(':').trim() : commitMessage;
3295532975
if (commitMessage.startsWith('feat') || commitMessage.startsWith('Added')) {
32956-
categorizedCommits.Added.push(`- ${commitMessage}`);
32976+
categorizedCommits.Added.push(`- ${message}`);
3295732977
}
3295832978
else if (commitMessage.startsWith('fix') || commitMessage.startsWith('Fixed')) {
32959-
categorizedCommits.Fixed.push(`- ${commitMessage}`);
32979+
categorizedCommits.Fixed.push(`- ${message}`);
3296032980
}
3296132981
else {
32962-
categorizedCommits.Changed.push(`- ${commitMessage}`);
32982+
categorizedCommits.Changed.push(`- ${message}`);
3296332983
}
3296432984
}
3296532985
for (const category in categorizedCommits) {
@@ -32970,6 +32990,10 @@ class ChangelogService {
3297032990
}
3297132991
return changelogContent;
3297232992
}
32993+
/**
32994+
* Update the changelog file with the new content.
32995+
* @param changelogContent The new changelog content to add.
32996+
*/
3297332997
async updateChangelog(changelogContent) {
3297432998
const changelogPath = 'CHANGELOG.md';
3297532999
const existingChangelog = await this.fileHandler.readFile(changelogPath);

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@
5353
"vitest": "^3.2.4",
5454
"yaml": "^2.8.1"
5555
}
56-
}
56+
}

0 commit comments

Comments
 (0)