-
Notifications
You must be signed in to change notification settings - Fork 74
71 lines (60 loc) · 2.2 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
name: Release Charts
on:
push:
branches:
- master
paths:
- charts/**
env:
GITHUB_TOKEN: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
jobs:
release:
if: github.repository_owner == 'netdata'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ env.GITHUB_TOKEN }}
- name: Prepare Environment
run: pip3 install ruamel-yaml semver
- name: Configure Git
run: |
git config --global user.name Netdatabot
git config --global user.email [email protected]
- name: Get current version
id: get_current_var
run: echo "current_version=$(.github/scripts/update_versions.py get_chart_version)" >> $GITHUB_OUTPUT
- name: Update Files
run: .github/scripts/update_versions.py set_chart_version
- name: Get the new version
id: new_version_var
run: echo "new_version=$(.github/scripts/update_versions.py get_chart_version)" >> $GITHUB_OUTPUT
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Commit new version
id: commit_version
continue-on-error: true
run: |
git commit -am "[skip ci] New Chart version to ${{ steps.new_version_var.outputs.new_version }}"
git push
- name: Delete release tag in case of version update commit failure
id: delete-tag
if: steps.commit_version.outcome == 'failure'
run: |
git push origin --delete "netdata-${{ steps.new_version_var.outputs.new_version }}"
git ls-remote --tags
- name: Update Netdata Infra
if: steps.delete-tag.outcome == 'skipped'
uses: benc-uk/workflow-dispatch@v1
with:
token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
repo: ${{ secrets.NETDATA_INFRA_REPO }}
workflow: Netdata Helm Chart Version Bump PR
ref: master
inputs: '{"version": "${{ steps.new_version_var.outputs.new_version }}", "previous_version": "${{ steps.get_current_var.outputs.current_version }}"}'
continue-on-error: true