build: generate changelog automatically
This issue of generating automated changelog can be separated into two parts:
- Making sure each MR contains information that can be used for generating a changelog
- Collecting the aforementioned information and creating changelog at the time of release
This MR handles the second part. It requires the rules enforced by !85 (merged).
Problem
In !85 (merged) we started enforcing the conventional commit message format. This MR uses these formatted commits to generate a changelog.
Solution
We include the conventional-changelog dependency in our project and run conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md
before we tag a new version of the extension.
This will automatically take the changes since the last tag and generates a changelog in the same format as the one in gitlab-ui.
Example
-
I created two example commits
feat(statusbar): add logo to the statusbar
fix(treeview): removing faulty issues
-
Running
npm version minor
produced the following commit:
commit 14c1b180a150be680233335c8ac3a6f2a18cbd9f
Author: Tomas Vik <tvik@gitlab.com>
Date: Tue Aug 11 12:44:14 2020 +0200
3.3.0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a3bc1e0..a9e144f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,17 @@
+# [3.3.0](https://gitlab.com/gitlab-org/gitlab-vscode-extension/compare/v3.2.0...v3.3.0) (2020-08-11)
+
+
+### Bug Fixes
+
+* **treeview:** removing faulty issues ([fbc81ea](https://gitlab.com/gitlab-org/gitlab-vscode-extension/commit/fbc81ea900edec83504921ea047b04b552206513))
+
+
+### Features
+
+* **statusbar:** add logo to the statusbar ([efaeb8f](https://gitlab.com/gitlab-org/gitlab-vscode-extension/commit/efaeb8f92711e172892ae51af474f6bd0285a83e))
+
+
+
# CHANGELOG
## v3.2.0 - 2020-08-03
diff --git a/package-lock.json b/package-lock.json
index 410a02f..f68184e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "gitlab-workflow",
- "version": "3.2.0",
+ "version": "3.3.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index 3f26126..a91cc04 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "gitlab-workflow",
"displayName": "GitLab Workflow",
"description": "GitLab VSCode integration",
- "version": "3.2.0",
+ "version": "3.3.0",
"publisher": "GitLab",
"license": "MIT",
"repository": {
semantic-release
Future: There is a potential of configuring the semantic-release
toolchain to completely automate the release process. The semantic-release
uses the conventional commits and and conventional-changelog
module under the hood. That means we are ready for using semantic-release
later on.
The main problem is that the semantic-release
doesn't currently support releasing VS Code extensions easily. There is an unofficial plugin raix/semantic-release-vsce but it doesn't seem too well maintained and only supports Microsoft marketplace (no open-vsx).
We might be able to use the exec plugin and write our custom scripts in the future.
Note: I had to run npm audit fix
to fix some known vulnerabilities in the conventional-changelog
dependencies.
Part of #198 (closed)