2021-09-07 08:20:19 +00:00
|
|
|
name: "Renovate: Bump on Push"
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2022-07-22 18:23:01 +00:00
|
|
|
- "renovate/**"
|
2021-09-07 08:20:19 +00:00
|
|
|
tags-ignore:
|
2022-07-22 18:23:01 +00:00
|
|
|
- "**"
|
2021-09-07 08:20:19 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
renovate-bump:
|
|
|
|
name: Get changed Apps
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2022-04-22 19:28:18 +00:00
|
|
|
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
2021-09-07 08:20:19 +00:00
|
|
|
name: Checkout
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
token: ${{ secrets.BOT_TOKEN }}
|
2022-04-22 19:28:18 +00:00
|
|
|
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
2021-09-07 08:20:19 +00:00
|
|
|
name: Checkout
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
ref: master
|
|
|
|
path: master
|
|
|
|
- uses: dorny/paths-filter@v2
|
|
|
|
id: filter
|
|
|
|
with:
|
|
|
|
list-files: json
|
|
|
|
filters: |
|
|
|
|
changed:
|
|
|
|
- 'charts/stable/**'
|
|
|
|
- 'charts/incubator/**'
|
2022-06-07 17:41:19 +00:00
|
|
|
- 'charts/SCALE/**'
|
2021-09-07 08:20:19 +00:00
|
|
|
- 'charts/library/**'
|
2021-11-08 13:55:20 +00:00
|
|
|
- 'charts/dependency/**'
|
2021-11-14 10:43:45 +00:00
|
|
|
- 'charts/core/**'
|
2022-02-04 20:06:27 +00:00
|
|
|
- 'charts/enterprise/**'
|
|
|
|
- 'charts/games/**'
|
2021-09-07 08:20:19 +00:00
|
|
|
- name: Filter filter-output
|
|
|
|
run: echo '${{ toJson(steps.filter.outputs) }}' > changes.json
|
|
|
|
- name: Bump
|
|
|
|
run: |
|
2022-07-22 18:23:01 +00:00
|
|
|
APPS=$(jq --raw-output '.changed_files | fromjson | .[] |= sub("(?<filepath>(?<first_directory>(?<root1>[\/]?)[^\/]+\/)(?<second_directory>(?<root2>[\/]?)[^\/]+\/)(?<third_directory>(?<root3>[\/]?)[^\/]+)(?<extra_paths>.+))"; "\(.third_directory)") | unique' changes.json | jq -r '.[]')
|
|
|
|
echo "changed apps: ${APPS[*]}"
|
|
|
|
for chart in ${APPS[*]}
|
|
|
|
do
|
|
|
|
if [[ "${chart}" == '.gitkee' ]]; then
|
|
|
|
echo "Skipping..."
|
|
|
|
return
|
|
|
|
elif test -f "./charts/stable/${chart}/Chart.yaml"; then
|
|
|
|
train="stable"
|
|
|
|
elif test -f "./charts/incubator/${chart}/Chart.yaml"; then
|
|
|
|
train="incubator"
|
|
|
|
elif test -f "./charts/SCALE/${chart}/Chart.yaml"; then
|
|
|
|
train="SCALE"
|
|
|
|
elif test -f "./charts/library/${chart}/Chart.yaml"; then
|
|
|
|
train="library"
|
|
|
|
elif test -f "./charts/dependency/${chart}/Chart.yaml"; then
|
|
|
|
train="dependency"
|
|
|
|
elif test -f "./charts/core/${chart}/Chart.yaml"; then
|
|
|
|
train="core"
|
|
|
|
elif test -f "./charts/games/${chart}/Chart.yaml"; then
|
|
|
|
train="games"
|
|
|
|
elif test -f "./charts/enterprise/${chart}/Chart.yaml"; then
|
|
|
|
train="enterprise"
|
|
|
|
else
|
|
|
|
train="incubator"
|
|
|
|
fi
|
|
|
|
echo "Comparing versions for ${train}/${chart}"
|
|
|
|
master=$(cat ./master/charts/${train}/${chart}/Chart.yaml | grep "^version")
|
|
|
|
current=$(cat ./charts/${train}/${chart}/Chart.yaml | grep "^version")
|
|
|
|
echo "master version: ${master}"
|
|
|
|
echo "current version: ${current}"
|
|
|
|
if [[ "${master}" != "${current}" ]]; then
|
|
|
|
echo "Version does not have to be bumped"
|
|
|
|
else
|
|
|
|
echo "Bumping patch version for ${train}/${chart}"
|
|
|
|
./tools/bump.sh patch ./charts/${train}/${chart}
|
|
|
|
fi
|
|
|
|
done
|
2021-09-07 08:20:19 +00:00
|
|
|
- name: Cleanup
|
|
|
|
run: |
|
|
|
|
rm -rf changes.json
|
|
|
|
rm -rf master
|
|
|
|
- name: Commit and Push new version
|
|
|
|
run: |
|
|
|
|
git config user.name "TrueCharts-Bot"
|
|
|
|
git config user.email "bot@truecharts.org"
|
|
|
|
git add --all
|
2022-08-08 21:57:58 +00:00
|
|
|
git commit -sm "Commit bumped Chart Version" || exit 0
|
2021-09-07 08:20:19 +00:00
|
|
|
git push
|