File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ name: Release
22
33on :
44 push :
5- tags :
6- - ' v*'
5+ branches :
6+ - main
7+ paths :
8+ - ' package.json'
79
810permissions :
911 contents : write
@@ -15,14 +17,34 @@ jobs:
1517 GOTOOLCHAIN : auto
1618 steps :
1719 - uses : actions/checkout@v6
18-
19- - uses : actions/setup-go@v5
2020 with :
21- go-version : ' 1.25'
21+ fetch-depth : 2
22+
23+ - name : Check version change
24+ id : check
25+ run : |
26+ CURRENT=$(jq -r .version package.json)
27+ PREVIOUS=$(git show HEAD~1:package.json 2>/dev/null | jq -r .version 2>/dev/null || echo "")
28+ if [ "$CURRENT" != "$PREVIOUS" ] && [ -n "$CURRENT" ]; then
29+ echo "version=${CURRENT}" >> "$GITHUB_OUTPUT"
30+ echo "changed=true" >> "$GITHUB_OUTPUT"
31+ else
32+ echo "changed=false" >> "$GITHUB_OUTPUT"
33+ fi
34+
35+ - name : Create tag
36+ if : steps.check.outputs.changed == 'true'
37+ run : |
38+ git tag "v${{ steps.check.outputs.version }}"
39+ git push origin "v${{ steps.check.outputs.version }}"
2240
2341 - uses : pnpm/action-setup@v4
42+ if : steps.check.outputs.changed == 'true'
2443
2544 - uses : grafana/plugin-actions/build-plugin@release
45+ if : steps.check.outputs.changed == 'true'
46+ env :
47+ GITHUB_REF : refs/tags/v${{ steps.check.outputs.version }}
2648 with :
2749 go-version : ' 1.25'
2850 node-version : ' 24'
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11{
22 "name" : " datasource-databend" ,
3- "version" : " 1.2.0 " ,
3+ "version" : " 1.2.1 " ,
44 "description" : " Grafana datasource plugin for Databend" ,
55 "scripts" : {
66 "build" : " webpack -c ./.config/webpack/webpack.config.ts --env production" ,
You can’t perform that action at this time.
0 commit comments