Skip to content

Commit 8d1717a

Browse files
authored
Add CHANGELOG.md (#306)
* add CHANGELOG.md * fix typos * remove subsubsections in `CHANGELOG.md` * update PR template * rename `change_log` as `changelog` * fix typo * fix typo * minor changes
1 parent e4cf394 commit 8d1717a

File tree

8 files changed

+83
-5
lines changed

8 files changed

+83
-5
lines changed

.github/pull_request_template.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
## Checklist
22
Thank you for contributing to `QuantumToolbox.jl`! Please make sure you have finished the following tasks before opening the PR.
33

4-
- [ ] Please read [Contributing to QuantumToolbox.jl](https://qutip.org/QuantumToolbox.jl/stable/resources/contribute).
4+
- [ ] Please read [Contributing to QuantumToolbox.jl](https://qutip.org/QuantumToolbox.jl/stable/resources/contributing).
55
- [ ] Any code changes were done in a way that does not break public API.
66
- [ ] Appropriate tests were added and tested locally by running: `make test`.
77
- [ ] Any code changes should be `julia` formatted by running: `make format`.
88
- [ ] All documents (in `docs/` folder) related to code changes were updated and able to build locally by running: `make docs`.
9+
- [ ] (If necessary) the `CHANGELOG.md` should be updated (regarding to the code changes) and built by running: `make changelog`.
910

1011
Request for a review after you have completed all the tasks. If you have not finished them all, you can also open a [Draft Pull Request](https://github.blog/2019-02-14-introducing-draft-pull-requests/) to let the others know this on-going work.
1112

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Enforces the update of the file CHANGELOG.md on every pull request
2+
# Can be skipped with the `Skip ChangeLog` label
3+
name: ChangeLog Update Check
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
7+
8+
jobs:
9+
changelog:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: dangoslen/changelog-enforcer@v3
13+
with:
14+
skipLabels: 'Skip ChangeLog'

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# ChangeLog
2+
3+
All notable changes to [`QuantumToolbox.jl`](https://github.com/qutip/QuantumToolbox.jl) will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## Unreleased
9+
10+
- *__We will start to write changelog once we have the first standard release.__*
11+
12+
## [v0.21.4] (2024-11-13)
13+
14+
- This is just a demonstration about [`Changelog.jl`](https://github.com/JuliaDocs/Changelog.jl). ([#139], [#306])
15+
16+
17+
<!-- Links generated by Changelog.jl -->
18+
19+
[v0.21.4]: https://github.com/qutip/QuantumToolbox.jl/releases/tag/v0.21.4
20+
[#139]: https://github.com/qutip/QuantumToolbox.jl/issues/139
21+
[#306]: https://github.com/qutip/QuantumToolbox.jl/issues/306

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ JULIA:=julia
22

33
default: help
44

5+
setup:
6+
${JULIA} -e 'import Pkg; Pkg.add(["JuliaFormatter", "Changelog"])'
7+
58
format:
69
${JULIA} -e 'using JuliaFormatter; format(".")'
710

11+
changelog:
12+
${JULIA} -e 'using Changelog; Changelog.generate(Changelog.CommonMark(), "CHANGELOG.md"; repo = "qutip/QuantumToolbox.jl")'
13+
814
test:
915
${JULIA} --project -e 'using Pkg; Pkg.resolve(); Pkg.test()'
1016

@@ -16,14 +22,16 @@ vitepress:
1622
npm --prefix docs i
1723
npm --prefix docs run docs:dev
1824

19-
all: format test docs vitepress
25+
all: setup format changelog test docs vitepress
2026

2127
help:
2228
@echo "The following make commands are available:"
29+
@echo " - make setup: install the dependencies for make command"
2330
@echo " - make format: format codes with JuliaFormatter"
31+
@echo " - make changelog: generate changelog"
2432
@echo " - make test: run the tests"
2533
@echo " - make docs: instantiate and build the documentation"
2634
@echo " - make vitepress: start Vitepress site of documentation"
2735
@echo " - make all: run every commands in the above order"
2836

29-
.PHONY: default format test docs vitepress all help
37+
.PHONY: default setup format changelog test docs vitepress all help

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ build/
22
node_modules/
33
package-lock.json
44
Manifest.toml
5+
src/resources/changelog.md

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[deps]
22
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
33
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
4+
Changelog = "5217a498-cd5d-4ec6-b8c2-9b85a09b6e3e"
45
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
56
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
67
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"

docs/make.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,26 @@ using QuantumToolbox
55
using Documenter
66
using DocumenterVitepress
77
using DocumenterCitations
8+
using Changelog
89

910
DocMeta.setdocmeta!(QuantumToolbox, :DocTestSetup, :(using QuantumToolbox); recursive = true)
1011

1112
const DRAFT = false # set `true` to disable cell evaluation
1213

14+
# generate bibliography
1315
bib = CitationBibliography(
1416
joinpath(@__DIR__, "src", "resources", "bibliography.bib"),
1517
style=:authoryear,
1618
)
1719

20+
# generate changelog
21+
Changelog.generate(
22+
Changelog.Documenter(),
23+
joinpath(@__DIR__, "..", "CHANGELOG.md"),
24+
joinpath(@__DIR__, "src", "resources", "changelog.md");
25+
repo = "qutip/QuantumToolbox.jl",
26+
)
27+
1828
const PAGES = [
1929
"Home" => "index.md",
2030
"Getting Started" => [
@@ -56,8 +66,8 @@ const PAGES = [
5666
],
5767
"Resources" => [
5868
"API" => "resources/api.md",
59-
# "Change Log" => "resources/changelog.md",
6069
"Bibliography" => "resources/bibliography.md",
70+
"ChangeLog" => "resources/changelog.md",
6171
"Contributing to QuantumToolbox.jl" => "resources/contributing.md",
6272
],
6373
]

docs/src/resources/contributing.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ We use [`JuliaFormatter.jl`](https://github.com/domluna/JuliaFormatter.jl) to fo
3838

3939
To format the changed codes, use the following command under the *__root directory of the repository__* you are working on:
4040

41+
!!! note "Requirements"
42+
If this is your first time running `make` command in the local repository you are working on or you just had reinstalled `Julia`, you should run `make setup` first.
43+
4144
```shell
4245
make format
4346
```
@@ -69,4 +72,23 @@ This will start a local Vitepress site of documentation at `http://localhost:517
6972

7073
## [Update ChangeLog](@id doc-Contribute:Update-ChangeLog)
7174

72-
(TBA)
75+
The changelog is written in the file `CHANGELOG.md` in the repository. If you add some changes to the repository and made a PR, you should also add some messages or release notes together with the related PRs/issues entries to `CHANGELOG.md`. For example, add a new line in `CHANGELOG.md`:
76+
77+
```markdown
78+
- some messages to describe the changes. ([#issue-ID], [#PR-ID])
79+
```
80+
81+
See also the [ChangeLog page](@ref ChangeLog) for more examples.
82+
83+
After that, you can run the following command under the *__root directory of the repository__* you are working on:
84+
85+
!!! note "Requirements"
86+
If this is your first time running `make` command in the local repository you are working on or you just had reinstalled `Julia`, you should run `make setup` first.
87+
88+
```shell
89+
make changelog
90+
```
91+
92+
This will automatically generate the full URLs for the references to PRs/issues by utilizing [`Changelog.jl`](https://github.com/JuliaDocs/Changelog.jl).
93+
94+
If the changes you made are not necessary to be recorded in `CHANGELOG.md`, you can add the label `[Skip ChangeLog]` to the PR you made in the GitHub repository.

0 commit comments

Comments
 (0)