Skip to content

Commit

Permalink
trying workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrmr33 committed Mar 13, 2024
1 parent 75af98f commit d7f75bf
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 2 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/bump-chart-dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Bump Chart Dependencies

on:
push:
branches:
- feat/CON-24236-auto-update-support
workflow_call:
inputs:
chart-name:
description: 'The name of the chart'
default: 'ocean-kubernetes-controller'
type: string

jobs:
bump-local-dependencies:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
repository: spotinst/charts
- uses: gabe565/[email protected]
- uses: azure/[email protected]
with:
version: v3.12.1

- name: Check Dependencies Versions
id: check-dependencies
run: |
for chart in `yq '.dependencies[].name' ./charts/ocean-kubernetes-controller/Chart.yaml`; do
if [ ! -f ./charts/${chart}/Chart.yaml ]; then
continue
fi
dep_version=$(yq '.dependencies[] | select(.name == "'${chart}'") | .version' ./charts/ocean-kubernetes-controller/Chart.yaml)
chart_version=$(yq '.version' ./charts/${chart}/Chart.yaml)
if [ "${dep_version}" == "${chart_version}" ]; then
echo "Dependency \"${chart}\" has version \"${dep_version}\" and is up to date"
continue
fi
echo "Dependency \"${chart}\" has version \"${dep_version}\" but should be \"${chart_version}\", bumping to \"${chart_version}\""
yq -i '(.dependencies[] | select(.name == "'${chart}'") | .version) = "'${chart_version}'"' ./charts/ocean-kubernetes-controller/Chart.yaml
done
- name: Check Diff
id: check-diff
run: |
git diff --exit-code && (echo "Nothing to do" && echo "should_update=false" >> $GITHUB_OUTPUT && exit 0) || echo "Changes detected"
echo "should_update=true" >> $GITHUB_OUTPUT
- name: Update Dependencies
if: steps.check-diff.outputs.should_update == 'true'
run: |
helm dependency update ./charts/ocean-kubernetes-controller
- name: Update helm docs
if: steps.check-diff.outputs.should_update == 'true'
run: |
helm-docs --chart-to-generate charts/ocean-kubernetes-controller
- name: Generate version bump commit
if: steps.check-diff.outputs.should_update == 'true'
run: |
git config user.name ${{ github.actor }}
git config user.email '${{ github.actor }}@users.noreply.github.com'
git add .
git commit -a -m "bump ocean-kubernetes-controller dependencies"
- name: Create Pull Request
if: steps.check-diff.outputs.should_update == 'true'
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.CR_TOKEN }}
title: '[bump] ocean-kubernetes-controller dependencies'
branch: bump/ocean-kubernetes-controller dependencies
delete-branch: true
labels: bump_dependencies
10 changes: 8 additions & 2 deletions charts/ocean-kubernetes-controller/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@ dependencies:
- name: metrics-server
repository: https://kubernetes-sigs.github.io/metrics-server
version: 3.11.0
digest: sha256:472915f28d2f1016d5e51ec6c5173c3c01856132a1012dc951242452533b99a9
generated: "2023-09-27T13:21:52.700746+03:00"
- name: ocean-network-client
repository: https://charts.spot.io
version: 1.0.17
- name: ocean-metric-exporter
repository: https://charts.spot.io
version: 1.0.10
digest: sha256:5c6db1e80d216b94e99a5e85db30d4d759087f41e2b9cfe29365f884c4991010
generated: "2024-03-13T12:07:39.544519+02:00"
8 changes: 8 additions & 0 deletions charts/ocean-kubernetes-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,13 @@ dependencies:
version: 3.11.0
repository: https://kubernetes-sigs.github.io/metrics-server
condition: metrics-server.deployChart
- name: ocean-network-client
version: 1.0.17
repository: https://charts.spot.io
condition: ocean-network-client.deployChart
- name: ocean-metric-exporter
version: 1.0.10
repository: https://charts.spot.io
condition: ocean-metric-exporter.deployChart
annotations:
artifacthub.io/prerelease: "true"
Binary file not shown.
Binary file not shown.

0 comments on commit d7f75bf

Please sign in to comment.