Skip to content

Commit 5ab0e41

Browse files
trigger release on change in package.json (#180)
1 parent 8269a3a commit 5ab0e41

File tree

4 files changed

+45
-9
lines changed

4 files changed

+45
-9
lines changed

.github/workflows/issue-release.yaml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: issue release
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- check / frontend
7+
- check / backend
8+
- codeql / frontend
9+
- codeql / backend
10+
types:
11+
- completed
12+
branches:
13+
- main
14+
15+
jobs:
16+
issue:
17+
name: Push tag
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
- name: Import GPG key
27+
uses: crazy-max/ghaction-import-gpg@v6
28+
with:
29+
gpg_private_key: ${{ secrets.VM_BOT_GPG_PRIVATE_KEY }}
30+
passphrase: ${{ secrets.VM_BOT_PASSPHRASE }}
31+
git_user_signingkey: true
32+
git_commit_gpgsign: true
33+
- name: Push a tag if it doesn't exist
34+
run: |
35+
TAG="v$(yq '.version' package.json)"
36+
if git show-ref --tags --verify --quiet "refs/tags/${TAG}"; then
37+
echo "Tag ${TAG} exists"
38+
else
39+
echo "Tag ${TAG} does not exist, pushing a new one"
40+
git tag ${TAG}
41+
git push origin ${TAG}
42+
fi

.github/workflows/release.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ jobs:
3434
${{ runner.os }}-yarn-
3535
- name: Build plugin
3636
run: |
37-
export PLUGIN_TAG="${PKG_TAG#v}"
38-
yq -iP '.version=env(PLUGIN_TAG)' package.json -o json
3937
make vl-plugin-check
4038
- name: Prepare release notes
4139
run: |

README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,8 @@ This command will build frontend part and backend part or the plugin and locate
283283
## How to make new release
284284

285285
1. Make sure there are no open security issues.
286-
1. Create a release tag:
287-
* `git tag -s v1.xx.y` in `master` branch
288-
1. Run `TAG=v1.xx.y make build-release` to build and package binaries in `*.tar.gz` release archives.
289-
1. Run `git push origin v1.xx.y` to push the tag created `v1.xx.y` at step 2 to public GitHub repository
290-
1. Go to <https://github.com/VictoriaMetrics/victorialogs-datasource/releases> and verify that draft release with the name `TAG` has been created and this release contains all the needed binaries and checksums.
291-
1. Remove the `draft` checkbox for the `TAG` release and manually publish it.
286+
1. Change version in package.json in a `main` branch, this should trigger creation of a new release.
287+
1. Go to [releases page](https://github.com/VictoriaMetrics/victorialogs-datasource/releases) once pipeline is finished and verify release with the name `TAG` has been created and has all the needed binaries and checksums attached.
292288

293289
## Notes
294290

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "victoriametrics-logs-datasource",
3-
"version": "0.13.1",
3+
"version": "0.13.2",
44
"description": "VictoriaLogs datasource plugin for grafana",
55
"scripts": {
66
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",

0 commit comments

Comments
 (0)