-
Notifications
You must be signed in to change notification settings - Fork 7
46 lines (41 loc) · 1.36 KB
/
app_version_update.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
name: Check for new Cloudprober release
on:
schedule:
- cron: '5 */4 * * *'
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
update-chart-yaml:
name: Update chart version and release
runs-on: ubuntu-latest
steps:
- name: Check out repo hosting code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
id: go
- name: Get cloudprober version
run: |-
LAST_VERSION=$(go list -m -versions github.com/cloudprober/cloudprober | tr ' ' '\n' | tac | head -1)
echo "CLOUDPROBER_VERSION=${LAST_VERSION}" >> $GITHUB_ENV
- name: Update app version in Chart.yaml
run: |-
sed -i "s/appVersion: .*$/appVersion: \'${CLOUDPROBER_VERSION}\'/" cloudprober/Chart.yaml
echo ">> New Chart.yaml"
cat cloudprober/Chart.yaml
echo "-----------------"
echo ">> Chart.yaml diff"
git diff
- name: Commit and push Chart.yaml if it changed
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')
run: |-
git config user.name "Manu Garg"
git config user.email "manugarg@gmail.com"
git add cloudprober/Chart.yaml
git commit -m "[automated] Update app version" || exit 0
git push