-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (33 loc) · 1.41 KB
/
myprecious-scheduled-release.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
name: "My Precious: Stable Release (Scheduled)"
concurrency: helm-release
on:
schedule:
# 9:55am UTC is 21h55 NZST, giving us 5 min to run before the maint window starts 10pm weekdays NZ time
- cron: '55 09 * * *'
workflow_dispatch:
jobs:
release:
name: Release a stable version of the myprecious chart
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.RENOVATE_TOKEN }}
- name: Check if safe to release (and we're on a -pre version currently)
id: safe_to_release
run: |
grep 'safeToRelease: true' charts/other/myprecious/values.yaml && (grep ^version charts/other/myprecious/Chart.yaml | grep pre)
- name: Bump semver to stable
id: bump_semver
run: |
NEW_VERSION=$(grep -E "^version" charts/other/myprecious/Chart.yaml |sed -r 's/(version: )([0-9]+)\.([0-9]+)\.([0-9]+)(.*)/echo version: \2.\3.$((\4+1))/ge')
sed -i -E "s/^version:.*/${NEW_VERSION}/g" charts/other/myprecious/Chart.yaml
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
if: steps.safe_to_release.outcome == 'success'
- name: commit changes back
uses: stefanzweifel/git-auto-commit-action@v4
if: steps.safe_to_release.outcome == 'success'
with:
token: ${{ secrets.RENOVATE_TOKEN }}