Skip to content

Commit 74699c9

Browse files
committed
update the docs with the new version
1 parent 8462eec commit 74699c9

File tree

2 files changed

+18
-165
lines changed

2 files changed

+18
-165
lines changed

README.md

Lines changed: 6 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -3,119 +3,36 @@ Changelog-it
33

44
Changelog-it is a command line tool that helps you manage a changelog file for your project. It makes it easy to add new entries to the changelog, and it also provides commands to help you format and present the changelog in a way that is easy for users to read.
55

6-
The tool is written in JavaScript and can be installed using npm. Once it's installed, you can run changelog-it from the command line to see a list of available commands.
6+
The tool is written in Rust and can be installed using `cargo`. Once it's installed, you can run changelog-it from the command line to see a list of available commands.
77

88
Some of the features of the tool include:
99

10-
- Adding entries to the changelog: The add command allows you to add a new entry to the changelog. You can specify the type of entry (e.g. `Added`, `Changed`, `Fixed`), a summary of the change, and an optional description.
1110
- Formatting the changelog: The format command can be used to format the changelog in a way that is easy to read. It groups entries by type and sorts them by date.
1211
- Generating a release file: You can use the release command to generate a markdown file with the latest changes and upload it to your repository.
1312
- Customizable templates: You can set custom templates in order to format the generated changelog to your specific needs.
1413
- The tool is flexible and easy to use, and it's a great way to keep track of the changes in your project.
1514

16-
You can start using the tool by installing it with npm, and following the documentation provided in the page for further usage.
17-
1815
here are some available integrations we do to generate the release:
1916

20-
| Jira | Github | Gitlab | Slack |
21-
|--------------| --------------| --------------| --------------|
22-
23-
For example:
24-
25-
```bash
26-
changelog-it --range origin/prod...origin/master --release --gmudd --summary "some summary..."
27-
```
28-
29-
take a look on [this](https://github.com/falcucci/changelog-it/blob/master/changelog.example.md) file to check how it will looks like
30-
31-
You can also have it automatically post to slack by using the `--slack` flag.
32-
33-
## How it works
17+
| Github
18+
| --------------
3419

35-
The script looks for Jira issue keys, surrounded by square brackets (i.e. `[DEV-123]`), in the git commit logs. When it finds one, it associates that Jira issue ticket with that commit and adds it to the changelog.
20+
take a look on [this](https://github.com/falcucci/changelog-it/blob/master/templates/example.md) file to check how it will looks like
3621

3722
## Installation
3823

3924
```bash
40-
npm install -g -S @falcucci/changelog-it
41-
```
42-
43-
## Configuration
44-
45-
You'll need to configure Jira before you can use this effectively. Create a file called `changelog.config.js` and put it at the root of your workspace directory; where you'll call the `jira-changelog` command from.
46-
47-
Here's a simple example with sample Jira API values:
48-
49-
```javascript
50-
module.exports = {
51-
jira: {
52-
api: {
53-
host: "yoursite.atlassian.net",
54-
username: "jirauser",
55-
password: "s00persecurePa55w0rdBr0"
56-
},
57-
}
58-
}
25+
cargo install changelog-it
5926
```
6027

6128
To see all values suported, look at the `changelog.config.js` file at the root of this repo.
6229

63-
## Usage
64-
65-
```bash
66-
changelog-it --range origin/prod...origin/master --slack --release
67-
```
68-
69-
Assuming you deploy from the prod branch, this will generate a changelog with all commits after the last production deploy to the current master version.
70-
71-
If you define `sourceControl.defaultRange` in your config, you can run the command with the `--range` flag:
72-
73-
```bash
74-
changelog-it
75-
```
76-
7730
## Releases
7831

7932
You can automatically attach Jira issues to a release with the `--release` flag. For example, let's say we want to add all issues in the changelog to the "sprint-12" release:
8033

8134
```bash
82-
changelog-it --range origin/prod...origin/master --release sprint-12
83-
```
84-
85-
This will set the `fixVersions` of all issues to "sprint-12" in Jira.
86-
87-
## Slack
88-
89-
You can also have the script automatically post to slack.
90-
91-
First, get an API token from Slack for your workspace:
92-
https://api.slack.com/tokens
93-
94-
Then add slack to your configuration file:
95-
96-
```javascript
97-
module.exports = {
98-
slack: {
99-
apiKey: 'asdlfkjasdoifuoiucvlkxjcvoixucvi',
100-
channel: '#changelogs'
101-
},
102-
jira: {
103-
api: {
104-
host: "myapp.atlassian.net",
105-
username: "jirauser",
106-
password: "s00persecurePa55w0rdBr0"
107-
},
108-
}
109-
}
110-
```
111-
112-
* Add your API token to `slack.apiKey`.
113-
* `slack.channel` is the channel you want the script to send the changelog to.
114-
115-
Then simply add the `--slack` flag to the command:
116-
117-
```bash
118-
changelog-it --range origin/prod...origin/master --slack
35+
changelog-it --owner rust-lang --project rust --release 1.73.0 --github-token <token>
11936
```
12037

12138
You can automate it generating semantic version tags using the following command:
@@ -126,79 +43,3 @@ or creating an alias in your `.aliases` file:
12643
```bash
12744
alias release-me='curl -LsS https://raw.githubusercontent.com/falcucci/release-me/master/changelog-it.sh | bash -s $1 $2'
12845
```
129-
and run:
130-
```bash
131-
release-me <semantic-version> <summary>
132-
```
133-
134-
### GitLab CI
135-
136-
**note: this requires npm to run+**
137-
138-
Store the following envs in [GitLab CI variable](https://docs.gitlab.com/ee/ci/variables/#variables).
139-
140-
| name | description |
141-
| ---- | ----------- |
142-
| `GITLAB_API_KEY` | Gitlab api key |
143-
| `SLACK_API_KEY` | Slack api key |
144-
| `SLACK_CHANNELS` | Slack channels ids separeted by comma |
145-
| `GMUD_CHANNEL` | Slack gmud channels ids separeted by comma |
146-
147-
#### .gitlab-ci.yml sample
148-
149-
```yaml
150-
changelog:
151-
script:
152-
- changelog-it v1.0.0...v2.0.0 --release --gmud
153-
# Or using aliases above if you have it in a package.json
154-
- npm run changelog
155-
# Or using some script
156-
- curl -LsS https://raw.githubusercontent.com/falcucci/release-me/master/ci-changelog-it.sh | bash -s
157-
```
158-
159-
You can use changelog-it to generate changelogs and gmuds from anywhere with following
160-
environment variables.
161-
162-
```shell
163-
$ export GITLAB_API_KEY=haya14busa
164-
$ export SLACK_API_KEY=haya14busa
165-
$ export SLACK_CHANNELS=APOISFDUP
166-
$ export GMUD_CHANNEL=PAOISUFOPUAS
167-
```
168-
169-
## API
170-
The code used to generate the changelogs can also be used as modules in your JavaScript.
171-
See the module source for documentation.
172-
173-
For example:
174-
175-
```bash
176-
npm install -S @falcucci/changelog-it
177-
```
178-
179-
```javascript
180-
const Config = require('@falcucci/changelog-it').Config;
181-
const SourceControl = require('jira-changelog').SourceControl;
182-
const Jira = require('jira-changelog').Jira;
183-
184-
const gitRepoPath = '/home/user/source/'
185-
186-
// Get configuration
187-
const config = Config.getConfigForPath(gitRepoPath);
188-
189-
// Get commits for a range
190-
const source = new SourceControl(config);
191-
const range = {
192-
from: "origin/prod",
193-
to: "origin/master"
194-
};
195-
source.getCommitLogs(gitRepoPath, range).then((commitLogs) => {
196-
197-
// Associate git commits with jira tickets and output changelog object
198-
const jira = new Jira(config);
199-
jira.generate(commitLogs).then((changelog) => {
200-
console.log(changelog);
201-
});
202-
203-
});
204-
```

templates/example.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# rust-lang/rust - 1.73.0 (2023-08-07)
2+
3+
- [Issue numbers are enforced on active features; remove FIXME](https://github.com/rust-lang/rust/pull/114556)
4+
- [Remove FIXME about NLL diagnostic that is already improved](https://github.com/rust-lang/rust/pull/114558)
5+
- [update Miri](https://github.com/rust-lang/rust/pull/114560)
6+
- [stabilize abi_thiscall](https://github.com/rust-lang/rust/pull/114562)
7+
- [Rollup of 6 pull requests](https://github.com/rust-lang/rust/pull/114565)
8+
- [Rollup of 8 pull requests](https://github.com/rust-lang/rust/pull/114569)
9+
- [[miri][typo] Fix a typo in a vector_block comment.](https://github.com/rust-lang/rust/pull/114570)
10+
- [CI: do not hide error logs in a group](https://github.com/rust-lang/rust/pull/114573)
11+
- [:arrow_up: `rust-analyzer`](https://github.com/rust-lang/rust/pull/114576)
12+
- [Rollup of 9 pull requests](https://github.com/rust-lang/rust/pull/114585)

0 commit comments

Comments
 (0)