Update VM version #975
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update VM version | |
| on: | |
| workflow_dispatch: # Allow to manually run the workflow. | |
| schedule: | |
| - cron: '0 10 * * *' | |
| jobs: | |
| updateVersion: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Get latest VM release | |
| id: version | |
| run: | | |
| next_release=$(curl -sL https://api.github.com/repos/VictoriaMetrics/VictoriaMetrics/releases/latest | jq -r ".tag_name") | |
| echo "next_release=${next_release#v}" >> $GITHUB_OUTPUT | |
| current_release=$(<VERSION) | |
| echo "current_release=$current_release" >> $GITHUB_OUTPUT | |
| - name: Update version file and scripts | |
| if: steps.version.outputs.next_release != steps.version.outputs.current_release | |
| run: | | |
| echo ${{ steps.version.outputs.next_release }} > VERSION | |
| sed -i "s/${{ steps.version.outputs.current_release }}/${{ steps.version.outputs.next_release }}/g" ./Formula/vmagent.rb | |
| darwinAmd64Checksum=$(curl -sL https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${{ steps.version.outputs.next_release }}/vmutils-darwin-amd64-v${{ steps.version.outputs.next_release }}_checksums.txt | grep "vmutils-darwin" | awk '{ print $1 }') | |
| darwinArm64Checksum=$(curl -sL https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${{ steps.version.outputs.next_release }}/vmutils-darwin-arm64-v${{ steps.version.outputs.next_release }}_checksums.txt | grep "vmutils-darwin" | awk '{ print $1 }') | |
| sed -i "s/checksumAmd64 .*\"/checksumAmd64 = \"$darwinAmd64Checksum\"/g" ./Formula/vmagent.rb | |
| sed -i "s/checksumArm64 .*\"/checksumArm64 = \"$darwinArm64Checksum\"/g" ./Formula/vmagent.rb | |
| sed -i "s/${{ steps.version.outputs.current_release }}/${{ steps.version.outputs.next_release }}/g" ./Choco/vmagent/vmagent.nuspec | |
| windowsChecksum=$(curl -sL https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${{ steps.version.outputs.next_release }}/vmutils-windows-amd64-v${{ steps.version.outputs.next_release }}_checksums.txt | grep "vmutils-windows" | awk '{ print $1 }') | |
| sed -i "s/vmutilsChecksum .*\"/vmutilsChecksum = \"$windowsChecksum\"/g" ./Choco/vmagent/tools/chocolateyinstall.ps1 | |
| - name: Create pull request | |
| uses: peter-evans/create-pull-request@v5 | |
| with: | |
| commit-message: Update VM Version to ${{ steps.version.outputs.next_release }} | |
| title: Update VM Version to ${{ steps.version.outputs.next_release }} | |
| body: | | |
| Updates [victoria-metrics][1] to ${{ steps.version.outputs.next_release }} | |
| Auto-generated by [create-pull-request][2] | |
| [1]: https://github.com/VictoriaMetrics/VictoriaMetrics | |
| [2]: https://github.com/peter-evans/create-pull-request | |
| labels: dependencies, automated pr | |
| branch: version-updates |