From 78d9ae51c1b67f86ad6f4493ebcd5ea10d618c7d Mon Sep 17 00:00:00 2001 From: Martin Turoci Date: Mon, 26 Jun 2023 11:46:18 +0200 Subject: [PATCH] chore: Make changelog generator more reliable by using current package.json version instead of relying on git. --- Makefile | 1 + tools/changelog-generator/changelog.js | 3 ++- ui/Makefile | 5 +++++ ui/package.json | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 89a83a95fd..723e1587f6 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/tools/changelog-generator/changelog.js b/tools/changelog-generator/changelog.js index 3cce72fd0b..bcb8567938 100644 --- a/tools/changelog-generator/changelog.js +++ b/tools/changelog-generator/changelog.js @@ -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') { @@ -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) => { diff --git a/ui/Makefile b/ui/Makefile index 2434a22d42..a8a06d81d5 100644 --- a/ui/Makefile +++ b/ui/Makefile @@ -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 @@ -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}' diff --git a/ui/package.json b/ui/package.json index e59632fc9b..0e5df53472 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,6 +1,6 @@ { "name": "wave-ui", - "version": "0.1.0", + "version": "0.25.3", "private": true, "dependencies": { "@antv/g2": "^4.1.49",