-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (43 loc) · 1.71 KB
/
update-grist-image.yaml
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
name: Upgrade docker image in chart if needed
defaults:
run:
# GitHub Actions run without a TTY device. This is a workaround to get one,
# based on https://github.com/actions/runner/issues/241#issuecomment-842566950.
shell: 'script -O /dev/stdout -q -e -c "bash --noprofile --norc -eo pipefail {0}"'
on:
schedule:
- cron: "0 1 * * *"
jobs:
build:
name: Check grist_release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- id: grist_release
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: gristlabs/grist-core
- name: Format version
id: version
run: |
version=$(echo ${{ steps.grist_release.outputs.release }} | awk -F'v' '{print $2}')
if ! grep ' tag: "'"${version}"'"' charts/grist/values.yaml; then
sed -i '22s/ tag: .*/ tag: "'"${version}"'"/' charts/grist/values.yaml
cd charts/grist
./update_readme.sh
. ../../scripts/utils.sh
chart_version=$(cat Chart.yaml |awk '/version:/ {print $2}')
app_version=$(cat Chart.yaml |awk '/appVersion:/ {print $2}')
new_chart_version=$(increment_version $chart_version)
new_app_version=$(increment_version $app_version)
sed -i "s/${chart_version}/${new_chart_version}/g" Chart.yaml
sed -i "s/${app_version}/${new_app_version}/g" Chart.yaml
fi
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "[GRIST] Automatic upgrade version"
title: "[GRIST] Automatic upgrade version"