Skip to content

Track upstream k8s releases #655

Track upstream k8s releases

Track upstream k8s releases #655

name: Track upstream k8s releases
on:
workflow_dispatch:
schedule:
- cron: '37 5 * * *'
jobs:
track:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies
- name: Setup Python dependencies
run: pip install -r hack/generate-k8s-versions/requirements.txt
- name: Run k8s-version tracker
run: python ./hack/generate-k8s-versions/get-k8s-versions.py charts/cloudprofiles/values.yaml charts/cloudprofiles/Chart.yaml > ${{ runner.temp }}/commitmessage.txt
- name: Set commit message
id: commit_message_step
run: |
echo 'commit_message<<EOF' >> $GITHUB_OUTPUT
cat ${{ runner.temp }}/commitmessage.txt >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Commit (possible) changes
uses: stefanzweifel/git-auto-commit-action@v4
id: auto-commit-action
with:
commit_message: ${{ steps.commit_message_step.outputs.commit_message }}
- name: Get chart version from Chart.yaml
id: get_chart_version
uses: mikefarah/yq@master
with:
cmd: yq '.version' charts/cloudprofiles/Chart.yaml
if: steps.auto-commit-action.outputs.changes_detected == 'true'
- name: Create GitHub Release for the current version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ steps.get_chart_version.outputs.result }} --generate-notes
if: steps.auto-commit-action.outputs.changes_detected == 'true'