Skip to content

Commit

Permalink
chore: Make changelog generator more reliable by using current packag…
Browse files Browse the repository at this point in the history
…e.json version instead of relying on git.
  • Loading branch information
mturoci committed Jun 26, 2023
1 parent 985dad7 commit 78d9ae5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ publish-lightwave:
.PHONY: tag
tag: ## Bump version and tag
cd py && $(MAKE) tag
cd ui && $(MAKE) tag
cd r && $(MAKE) tag
cd tools/vscode-extension && $(MAKE) tag
cd tools/intellij-plugin && $(MAKE) tag
Expand Down
3 changes: 2 additions & 1 deletion tools/changelog-generator/changelog.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
const { version } = require('../../ui/package.json')

// WARNING: Works only on Linux and macOS. Windows is not supported.
if (process.platform === 'win32') {
Expand All @@ -14,7 +15,7 @@ const typesToChangelog = {
}

const categorizedCommits = require('child_process')
.execSync('git log $(git describe --tags --abbrev=0)..HEAD --oneline')
.execSync(`git log v${version}..HEAD --oneline`)
.toString()
.split('\n')
.reduce((categorizedCommits, commit) => {
Expand Down
5 changes: 5 additions & 0 deletions ui/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# HACK: Linux uses GNU sed, while OSX uses BSD - need to install gsed to unify.
SED=$(shell command -v gsed || command -v sed)

ci: ## Install Node dependencies
npm ci
Expand All @@ -20,6 +22,9 @@ test: ## Run tests
test-ci: ## Run tests in CI mode
npm run test:ci

tag: ## Run tests
$(SED) -i -r -e "s/\"version\".+/\"version\": \"$(VERSION)\",/" package.json

help: ## List all make tasks
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wave-ui",
"version": "0.1.0",
"version": "0.25.3",
"private": true,
"dependencies": {
"@antv/g2": "^4.1.49",
Expand Down

0 comments on commit 78d9ae5

Please sign in to comment.