Skip to content

Commit b06d20e

Browse files
committed
Add release tooling
1 parent 225a434 commit b06d20e

File tree

7 files changed

+122
-11
lines changed

7 files changed

+122
-11
lines changed

.bumpversion.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[bumpversion]
2+
current_version = 0.3.0
3+
files = package.json src/plugin.json
4+
commit = True
5+
tag = True
6+
tag_name = {new_version}
7+
allow_dirty = True
8+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ npm-debug.log
77
dist/
88
coverage/
99
artifacts/
10+
11+
.venv*
12+
bin/

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
## v0.4.0
55
- Rename to `grafana-worldmap-panel-ng` to allow side-by-side installation
66
with upstream *Grafana Worldmap Panel 0.2.0*.
7+
- Remove `/dist` folder from source code repository.
8+
- Add release tooling.
79

810

911
## v0.3.0
@@ -23,7 +25,7 @@
2325
- `showZoomControl: false`
2426
- `showAttribution: false`
2527
- `legendContainerSelector`
26-
- Add `Makefile` for macOS/Homebrew.
28+
- Add `Makefile` as entrypoint for repository tooling.
2729
- Fix popover labels text color for light theme ([#169](https://github.com/grafana/worldmap-panel/issues/169)).
2830
Thanks, [@dtheb](https://github.com/dtheb).
2931
- Add clickthrough option for circles, use fixed url ([#129](https://github.com/grafana/worldmap-panel/pull/129)).

Makefile

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# ============
2+
# Main targets
3+
# ============
4+
5+
6+
# -------------
7+
# Configuration
8+
# -------------
9+
10+
$(eval venvpath := .venv_util)
11+
$(eval pip := $(venvpath)/bin/pip)
12+
$(eval python := $(venvpath)/bin/python)
13+
$(eval bumpversion := $(venvpath)/bin/bumpversion)
14+
$(eval github-release := ./bin/github-release)
15+
16+
17+
# -----
18+
# Build
19+
# -----
20+
sdist:
21+
yarn build
22+
23+
24+
# -------
25+
# Release
26+
# -------
27+
28+
# Release this piece of software
29+
# Synopsis:
30+
# make release bump=minor (major,minor,patch)
31+
release: bumpversion push sdist publish-release
32+
33+
prepare-release:
34+
35+
@# Compute release name.
36+
$(eval name := grafana-worldmap-panel-ng)
37+
$(eval version := $(shell cat package.json | jq -r .version))
38+
$(eval releasename := $(name)-$(version))
39+
40+
$(eval zipfile := artifacts/$(releasename).zip)
41+
42+
create-release: prepare-release
43+
44+
@echo "Baking release artefacts for $(releasename)"
45+
46+
# Create .zip archive.
47+
@mkdir -p artifacts
48+
(cd dist; zip -r ../$(zipfile) *)
49+
50+
publish-release: check-github-release prepare-release create-release
51+
52+
@echo "Uploading release artefacts for $(releasename) to GitHub"
53+
54+
@# Show current releases.
55+
@#$(github-release) info --user hiveeyes --repo grafana-worldmap-panel
56+
57+
# Create Release.
58+
@#$(github-release) release --user hiveeyes --repo grafana-worldmap-panel --tag $(version) --draft
59+
$(github-release) release --user hiveeyes --repo grafana-worldmap-panel --tag $(version)
60+
61+
# Upload release artifacts.
62+
$(github-release) upload --user hiveeyes --repo grafana-worldmap-panel --tag $(version) --name $(notdir $(zipfile)) --file $(zipfile) --replace
63+
64+
65+
66+
# ===============
67+
# Utility targets
68+
# ===============
69+
bumpversion: install-releasetools
70+
@$(bumpversion) $(bump)
71+
72+
push:
73+
git push && git push --tags
74+
75+
install-releasetools: setup-virtualenv
76+
@$(pip) install --quiet 'bump2version==0.5.10' --upgrade
77+
78+
check-github-release:
79+
@test -e $(github-release) || (echo 'ERROR: "github-release" not found.\nPlease install "github-release" to "./bin/github-release".\nSee https://github.com/aktau/github-release\nand check "make install-github-release".'; exit 1)
80+
81+
install-github-release:
82+
83+
# https://github.com/aktau/github-release
84+
$(eval url := https://github.com/aktau/github-release/releases/download/v0.7.2/darwin-amd64-github-release.tar.bz2)
85+
86+
mkdir -p bin
87+
#@ cat ~/Downloads/darwin-amd64-github-release.tar.bz2
88+
curl $(url) | tar -xj --strip-components=3 -C bin/ bin/darwin/amd64/github-release
89+
90+
# Setup Python virtualenv
91+
setup-virtualenv:
92+
@test -e $(python) || `command -v virtualenv` --python=python3 --no-site-packages $(venvpath)
93+
94+
95+
# -------
96+
# Project
97+
# -------
98+
99+
grafana-start:
100+
# brew install grafana
101+
grafana-server --config=/usr/local/etc/grafana/grafana.ini --homepath /usr/local/share/grafana cfg:default.paths.logs=/usr/local/var/log/grafana cfg:default.paths.data=/usr/local/var/lib/grafana cfg:default.paths.plugins=/usr/local/var/lib/grafana/plugins
102+
103+
link-plugin:
104+
# This is also suitable for a Grafana installation on Homebrew
105+
ln -s `pwd` /usr/local/var/lib/grafana/plugins/grafana-worldmap-panel-ng

Makefile.Homebrew

Lines changed: 0 additions & 7 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "grafana-worldmap-panel-ng",
3-
"version": "0.4.0",
3+
"version": "0.3.0",
44
"description": "Worldmap Panel Plugin for Grafana",
55
"main": "src/module.js",
66
"scripts": {

src/plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
{"name": "USA", "path": "images/worldmap-usa.png"},
2424
{"name": "Light Theme", "path": "images/worldmap-light-theme.png"}
2525
],
26-
"version": "0.4.0",
27-
"updated": "2019-06-28"
26+
"version": "0.3.0",
27+
"updated": "2019-07-07"
2828
},
2929

3030
"dependencies": {

0 commit comments

Comments
 (0)