A helper project to generate release notes for our web applications.
I got the idea for this project from this article: Creating a Command Line Tool with JBang and PicoCLI to Generate Release Notes.
The original code can be found here: https://gist.github.com/rokon12/fd039cdcfa98920ea9e881bf18e33b0b
- Java 17 or higher version
gh
command line tool- At the 1st run of the application you can find a validation token for GitHub API access. You need to copy that code and authenticate with GitHub using that token.
This code fetches your GitHub API token securely.
It first checks if a cached token exists.
If not, it uses the gh
command-line tool to get your authentication status.
It launches the gh
login process if you're not logged in.
Once logged in, it extracts your API token from the gh
output and caches it for future use.
If there are any errors during this process, it throws an exception.
Important Note: This Application relies on the GitHub CLI (gh
).
If you haven't already installed it, you can find instructions for your operating system.
It is a command line script. It can be run either from a command line or from an IDE execution environment.
This application has a list of mandatory parameters:
-u
or-user
GitHub username-r
or--repo
GitHub repository name-s
or--since
Since commit hash-ut
or--until
Until commit hash
Optional parameters:
-f
or--file
Output file for release notes-v
or--version
Release version (default value:v1.0.0
)-o
or--output-format
Output format (default vale:MARKDOWN
). Currently it supportsMARKDOWN
orHTML
formats.
An example list of parameters:
--user=joe --repo=example --since=4c087123 --until=b5f64456 --file=release_notes_example --output-format=MARKDOWN
You need to have installed at least Java 17 and JAVA_HOME
env variable should point to that Java binary file.
$./gradlew bootJar
BUILD SUCCESSFUL in 2s
4 actionable tasks: 1 executed, 3 up-to-date
chmod u+x build/libs/releasenotes-0.0.1-SNAPSHOT.jar
java -jar build/libs/releasenotes-0.0.1-SNAPSHOT.jar --user=joe --repo=example --since=4c087123 --until=b5f64456 --file=release_notes_example --output-format=MARKDOWN
- Create a run configuration for the app under the Spring Boot option
- Select Java 17 under the
Build and run
option - In the
Modify options
dropdown addProgram arguments
- Into the
Program arguments
field add the parameters for executing the app. For example:--user=joe --repo=example --since=4c087123 --until=b5f64456 --file=release_notes_example --output-format=MARKDOWN
- Click on the run button in the toolbar or select the
Run..
command in theRun
menu and select the configuration you would like to execute.
The release_notes_example.md
file is going to be generated into the project root in the selected MARKDOWN
format.
The above defined parameters would create it for the example
repository of joe
user from the 4c087123
commit hash
until the b5f64456
commit hash.