Makefile Dependencies #379
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Makefile Dependencies | |
on: | |
schedule: | |
# everyday at midnight. | |
- cron: '0 0 * * *' | |
workflow_dispatch: {} | |
jobs: | |
update-dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
cache-dependency-path: "**/*.sum" | |
- name: Kubectl | |
run: | | |
export VERSION=`curl -L -s https://dl.k8s.io/release/stable.txt` | |
sed -i "/^KUBECTL_VERSION/c\KUBECTL_VERSION = $VERSION" Makefile | |
- name: K0s | |
run: | | |
# Remove the '-ec.X' suffix and only update if the prefix (upstream k0s release) has changed. | |
export CURVERSION=$(make print-K0S_VERSION) | |
export VERSION=`curl https://api.github.com/repos/k0sproject/k0s/releases/latest | jq -r .name` | |
if [ "$CURVERSION" != "$VERSION" ]; then | |
sed -i "/^K0S_VERSION/c\K0S_VERSION = $VERSION" Makefile | |
sed -i "/^K0S_BINARY_SOURCE_OVERRIDE/c\K0S_BINARY_SOURCE_OVERRIDE =" Makefile | |
make go.mod | |
fi | |
- name: Troubleshoot | |
run: | | |
export VERSION=`curl https://api.github.com/repos/replicatedhq/troubleshoot/releases/latest | jq -r .name` | |
sed -i "/^TROUBLESHOOT_VERSION/c\TROUBLESHOOT_VERSION = $VERSION" Makefile | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ secrets.GH_PAT }} | |
commit-message: Update Makefile versions | |
title: 'Update Makefile versions' | |
branch: automation/update-makefile | |
delete-branch: true | |
labels: | | |
automated-pr | |
makefile | |
type::chore | |
draft: false | |
base: "main" | |
body: | | |
Automated changes by the [cron-makefile-dependencies](https://github.com/replicatedhq/embedded-cluster/blob/main/.github/workflows/dependencies.yaml) GitHub action | |