Skip to content

rke2

rke2 #151

Workflow file for this run

name: rke2
on:
schedule:
- cron: "47 3 * * *"
push:
branches:
- main
paths:
- .github/workflows/rke2.yml
workflow_dispatch:
concurrency:
group: rke2
jobs:
fetch:
name: Fetch
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch
id: fetch
run: |
VERSION="$(
curl --silent --show-error --location --fail \
--url "https://api.github.com/repos/rancher/rke2/releases/latest" \
| jq --raw-output '.tag_name' \
| sed -E 's/^v([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)\+rke2r([[:digit:]]+)$/\1.\2/'
)"
if test -z "${VERSION}"; then
echo "Failed to fetch latest tag and extract version from GitHub"
exit 1
fi
echo "Got version <${VERSION}>"
echo "version=${VERSION}" >>${GITHUB_OUTPUT}
- name: Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
allowUpdates: true
name: "rke2 v${{ steps.fetch.outputs.version }}"
tag: rke2/${{ steps.fetch.outputs.version }}
draft: false
prerelease: false