Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/release-charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ on:
workflow_dispatch:
inputs:
charts_ref:
description: "Submit PR against the following rancher/charts branch (eg: dev-v2.10)"
description: "Submit PR against the following rancher/charts branch (eg: dev-v2.11)"
required: true
default: "dev-v2.11"
prev_webhook:
description: "Previous Webhook version (eg: v0.5.0-rc.13)"
description: "Previous Webhook version (eg: v0.7.0-rc.13)"
required: true
default: ""
new_webhook:
description: "New Webhook version (eg: v0.5.0-rc.14)"
description: "New Webhook version (eg: v0.7.0-rc.14)"
required: true
default: ""

Expand Down
44 changes: 37 additions & 7 deletions .github/workflows/release-rancher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ on:
workflow_dispatch:
inputs:
rancher_ref:
description: "Submit PR against the following rancher/rancher branch (eg: main)"
description: "Submit PR against the following rancher/rancher branch (eg: release/v2.11)"
required: true
default: "main"
default: "release/v2.11"
prev_webhook:
description: "Previous Webhook version (eg: v0.5.0-rc.13)"
description: "Previous Webhook version (eg: v0.7.0-rc.13)"
required: true
default: ""
new_webhook:
description: "New Webhook version (eg: v0.5.0-rc.14)"
description: "New Webhook version (eg: v0.7.0-rc.14)"
required: true
default: ""

Expand All @@ -29,6 +29,9 @@ jobs:
# Required for vault
id-token: write
steps:
- name: Install dependencies
run: sudo snap install yq --channel=v4/stable

- uses: actions/checkout@v4
with:
ref: "${{ env.WEBHOOK_REF }}"
Expand Down Expand Up @@ -59,6 +62,36 @@ jobs:
# Allow making git push request later on
persist-credentials: true

- name: Find charts branch
id: find_charts_branch
run: |
cd rancher
# Extract dev-v2.9 out of the following line:
# ChartDefaultBranch = NewSetting("chart-default-branch", "dev-v2.9")
charts_branch=$(grep '"chart-default-branch"' pkg/settings/setting.go | cut -d'"' -f4)
echo "charts_branch=$charts_branch" >> $GITHUB_OUTPUT

- uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/charts
ref: "${{ steps.find_charts_branch.outputs.charts_branch }}"
path: charts

# Prevents the Rancher CI to continuously fail while the webhook RC is not
# yet added to charts' index.yaml file due to caching.
- name: Verify RC exists
env:
CHARTS_BRANCH: "${{ steps.find_charts_branch.outputs.charts_branch }}"
run: |
cd charts
new_webhook_short=$(echo "$NEW_WEBHOOK" | sed 's|^v||') # e.g. 0.5.2-rc.3
# Empty output if the version is not found, otherwise the version will be outputed.
found=$(yq ".entries.rancher-webhook[].version | select(. == \"*$new_webhook_short\")" index.yaml)
if [ -z "$found" ]; then
echo "rancher-webhook RC version $NEW_WEBHOOK not found in charts (branch=$CHARTS_BRANCH). Aborting."
exit 1
fi

- name: Configure the committer
run: |
cd rancher
Expand All @@ -69,9 +102,6 @@ jobs:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
APP_USER: "${{ steps.app-token.outputs.app-slug }}[bot]"

- name: Install dependencies
run: sudo snap install yq --channel=v4/stable

- name: Run release script
run: |
cd rancher
Expand Down
Loading