Skip to content

Commit 3a7dc70

Browse files
committed
Add Makefile to assist in packaging and publishing
1 parent c8681a5 commit 3a7dc70

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
node_modules
22
npm-debug.log
3+
yarn-error.log
34
.DS_Store
45
.vscode
56
.idea
@@ -9,6 +10,5 @@ coverage/
910
artifacts/
1011

1112
.venv*
12-
bin/
1313
build/
1414
ci/

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ refreshing the page will be sufficient.
3737
7. Create zip package: `npx grafana-toolkit plugin:ci-package`
3838
When this process succeeds, packages can be found within the `ci/packages/` folder.
3939
The `Error signing manifest` warning can optionally be ignored, YMMV.
40+
41+
Steps 6. and 7. can be shortened by invoking `make package publish`.

Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# ===================
2+
# Package and publish
3+
# ===================
4+
5+
package:
6+
npx grafana-toolkit plugin:ci-build
7+
npx grafana-toolkit plugin:ci-build --finish
8+
npx grafana-toolkit plugin:ci-package
9+
10+
publish: check-tools check-token
11+
12+
@# Before running this, export your GitHub access token.
13+
@#export GITHUB_TOKEN=8542f7c47b1697a79ab7f105e1d79f054d0b5599
14+
15+
@# Read version from "package.json".
16+
$(eval version=$(shell cat package.json | jq --raw-output .version))
17+
18+
@# Create release on GitHub.
19+
github-release release --user panodata --repo grafana-map-panel --tag $(version) || true
20+
21+
@# Upload distribution package.
22+
$(eval distfile=ci/packages/grafana-map-panel-$(version).zip)
23+
github-release upload --user panodata --repo grafana-map-panel --tag $(version) --name $(notdir $(distfile)) --file $(distfile)
24+
25+
26+
check-tools:
27+
@jq --version >/dev/null 2>&1 || (echo 'ERROR: "jq" not found. Please install using "brew install jq" or download from https://github.com/stedolan/jq/releases.' && exit 1)
28+
@github-release --version >/dev/null 2>&1 || (echo 'ERROR: "github-release" not found. Please install using "brew install github-release" or download from https://github.com/github-release/github-release/releases.' && exit 1)
29+
30+
check-token:
31+
@test -n "$(GITHUB_TOKEN)" || (echo 'ERROR: GITHUB_TOKEN environment variable not set.' && exit 1)

0 commit comments

Comments
 (0)