You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before contributing, make sure to check the Contributing section in the root README.md file for more information on how to contribute to this project.
Goal
Set up automatic changelog generation for the project using conventional-changelog-cli and a custom configuration file. This will standardize release notes and provide a clear log of changes for each version.
Files Provided
The following files will be used to generate changelogs:
scripts/changelog-config.cjs:
This file contains the configuration for conventional-changelog-cli, transforming the commit types (e.g., 'feat', 'fix') into human-readable sections (e.g., 'Features', 'Bug Fixes').
scripts/generate-changelog.js:
This script reads version information from the gradle.properties file and uses the conventional-changelog-cli to generate a changelog.
constfs=require('fs');const{ execSync }=require('child_process');constpath=require('path');// Path to your gradle.properties fileconstgradlePropertiesPath=path.join(__dirname,'../gradle.properties');console.log(`Reading gradle.properties from: ${gradlePropertiesPath}`);try{// Read gradle.properties fileconstgradlePropertiesContent=fs.readFileSync(gradlePropertiesPath,'utf8');constversionCodeMatch=gradlePropertiesContent.match(/io\.imrekaszab\.eaplayers\.build\.version\.code=(\d+)/);constversionNameMatch=gradlePropertiesContent.match(/io\.imrekaszab\.eaplayers\.build\.version\.name=([^]+)/);if(!versionCodeMatch||!versionNameMatch){thrownewError('Version information not found in gradle.properties');}constcurrentVersionCode=versionCodeMatch[1];constcurrentVersionName=versionNameMatch[1];console.log(`Current version code: ${currentVersionCode}`);console.log(`Current version name: ${currentVersionName}`);// Set the environment variable for the versionprocess.env.VERSION=currentVersionName;// Generate changelog using conventional-changelogconstcommand=`conventional-changelog -p angular -i CHANGELOG.md -s --config scripts/changelog-config.cjs`;execSync(command,{stdio: 'inherit'});}catch(error){console.error(`Failed to generate changelog: ${error.message}`);process.exit(1);}
Steps
Update gradle.properties:
Ensure the gradle.properties file contains the correct version information.
In your terminal, navigate to the root of the project and run the generate-changelog.js script to generate a changelog based on the conventional commit history.
Example:
node scripts/generate-changelog.js
This will generate or update the CHANGELOG.md file with entries based on the commit history, grouped by categories such as Features, Bug Fixes, and Code Refactoring.
Modify the README.md to Include Changelog Instructions:
Update the README.md file to include a section on how to generate the changelog for the project.
Example:
### Generating Changelog
To generate the changelog for this project, follow these steps:
1.**Install Node.js and npm:**- If you don't have Node.js and npm installed, you can install them using Homebrew:
```bash
brew install node
```
2. **Install `conventional-changelog-cli`:**
- Open a terminal and run the following command to install the `conventional-changelog-cli` globally:
```bash npm install -g conventional-changelog-cli```
3. **Run the changelog generation script:**
- In your terminal, navigate to the root directory of your project and run:
```bash node scripts/generate-changelog.js```
This will read the version information from the `gradle.properties` file and generate the changelog based on the conventional commits using the configuration file located at `scripts/changelog-config.cjs`.
Tag the Release in main:
After generating the changelog and ensuring everything is correct, create a version tag in the main branch. The tag should follow the version number in gradle.properties, prefixed with a v.
Example:
git tag v0.1.1
git push origin v0.1.1
Validate Changelog Generation:
Ensure that after running the script, the CHANGELOG.md file is correctly generated or updated with the latest commit history.
Verify that the commit types are transformed according to the configuration in changelog-config.cjs.
Outcome
Once this task is complete, the project will have an automated changelog generation process based on conventional commits. This will standardize release notes and make it easier to track the history of changes between releases.
The text was updated successfully, but these errors were encountered:
Follow the Contribution Guidelines:
Contributing
section in the rootREADME.md
file for more information on how to contribute to this project.Goal
Set up automatic changelog generation for the project using
conventional-changelog-cli
and a custom configuration file. This will standardize release notes and provide a clear log of changes for each version.Files Provided
The following files will be used to generate changelogs:
scripts/changelog-config.cjs
:This file contains the configuration for
conventional-changelog-cli
, transforming the commit types (e.g., 'feat', 'fix') into human-readable sections (e.g., 'Features', 'Bug Fixes').scripts/generate-changelog.js
:This script reads version information from the
gradle.properties
file and uses theconventional-changelog-cli
to generate a changelog.Steps
Update
gradle.properties
:gradle.properties
file contains the correct version information.gradle.properties
:Run the Changelog Generation Script:
generate-changelog.js
script to generate a changelog based on the conventional commit history.Example:
This will generate or update the
CHANGELOG.md
file with entries based on the commit history, grouped by categories such as Features, Bug Fixes, and Code Refactoring.Modify the
README.md
to Include Changelog Instructions:README.md
file to include a section on how to generate the changelog for the project.Example:
Tag the Release in
main
:main
branch. The tag should follow the version number ingradle.properties
, prefixed with av
.Example:
Validate Changelog Generation:
CHANGELOG.md
file is correctly generated or updated with the latest commit history.changelog-config.cjs
.Outcome
Once this task is complete, the project will have an automated changelog generation process based on conventional commits. This will standardize release notes and make it easier to track the history of changes between releases.
The text was updated successfully, but these errors were encountered: