Skip to content

Commit df8a6cb

Browse files
committed
fix daily build: failing grafana plugin validator
Grafana plugin validator compares the current version with the latest published version and will only pass if the current version is greater than the latest published version. Before this change we only added `-testbuild.XXX` to the version of the plugin. And used info.version in `src/plugin.json`, but this only holds a placeholder. So if we want to increase the version we need to load version (not the placeholder) which is stored in package.json.
1 parent cb6db0c commit df8a6cb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/build/action.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ runs:
2828
- name: Adapt version of plugin to indicate this is not a official release
2929
shell: bash
3030
run: |
31-
VERSION=$(jq -r .info.version src/plugin.json)
31+
VERSION=$(jq -r .version package.json)
32+
# increase patch version, otherwise grafana plugin validator will fail:
33+
VERSION=$(echo "$VERSION" | perl -pe 's/^((\d+\.)*)(\d+)(.*)$/$1.($3+1).$4/e')
3234
VERSION=$VERSION-testbuild.${{ github.run_id }}
33-
jq ".info.version |= \"$VERSION\"" ./src/plugin.json > ./src/plugin.new.json
34-
mv ./src/plugin.new.json ./src/plugin.json
35+
jq ".version |= \"$VERSION\"" ./package.json > ./package.new.json
36+
mv ./package.new.json ./package.json
3537
if: ${{ inputs.release == 'false' }}
3638

3739
- name: Adapt README.md

0 commit comments

Comments
 (0)