Skip to content

trigger release on change in package.json #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/issue-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: issue release

on:
workflow_run:
workflows:
- check / frontend
- check / backend
- codeql / frontend
- codeql / backend
types:
- completed
branches:
- main

jobs:
issue:
name: Push tag
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.VM_BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.VM_BOT_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Push a tag if it doesn't exist
run: |
TAG="v$(yq '.version' package.json)"
if git show-ref --tags --verify --quiet "refs/tags/${TAG}"; then
echo "Tag ${TAG} exists"
else
echo "Tag ${TAG} does not exist, pushing a new one"
git tag ${TAG}
git push origin ${TAG}
fi
2 changes: 0 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ jobs:
${{ runner.os }}-yarn-
- name: Build plugin
run: |
export PLUGIN_TAG="${PKG_TAG#v}"
yq -iP '.version=env(PLUGIN_TAG)' package.json -o json
make vl-plugin-check
- name: Prepare release notes
run: |
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,8 @@ This command will build frontend part and backend part or the plugin and locate
## How to make new release

1. Make sure there are no open security issues.
1. Create a release tag:
* `git tag -s v1.xx.y` in `master` branch
1. Run `TAG=v1.xx.y make build-release` to build and package binaries in `*.tar.gz` release archives.
1. Run `git push origin v1.xx.y` to push the tag created `v1.xx.y` at step 2 to public GitHub repository
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.
1. Remove the `draft` checkbox for the `TAG` release and manually publish it.
1. Change version in package.json in a `main` branch, this should trigger creation of a new release.
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.

## Notes

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "victoriametrics-logs-datasource",
"version": "0.13.1",
"version": "0.13.2",
"description": "VictoriaLogs datasource plugin for grafana",
"scripts": {
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",
Expand Down
Loading