Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #26

Merged
merged 7 commits into from
Mar 7, 2025
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
10 changes: 5 additions & 5 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v1
uses: azure/setup-helm@v4.3.0
with:
version: v3.6.3
version: v3.17.1

# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
# yamllint (https://github.com/adrienverge/yamllint) which require Python
Expand All @@ -24,7 +24,7 @@ jobs:
python-version: 3.8

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.1.0
uses: helm/chart-testing-action@v2.7.0

- name: Run chart-testing (list-changed)
id: list-changed
Expand All @@ -38,7 +38,7 @@ jobs:
run: ct lint --config ct.yaml

- name: Create kind cluster
uses: helm/kind-action@v1.2.0
uses: helm/kind-action@v1.12.0
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -20,16 +20,12 @@ jobs:
git config user.email "[email protected]"

- name: Install Helm
uses: azure/setup-helm@v1
uses: azure/setup-helm@v4.3.0
with:
version: v3.4.1

- name: Add dependency chart repos
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
version: v3.17.1

- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.1.0
uses: helm/chart-releaser-action@v1.7.0
with:
charts_dir: charts
config: cr.yaml
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/update-local-path-provisioner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Sync Local Path Provisioner Chart

on:
schedule:
# Runs once a week, every Monday at 00:00 UTC
- cron: '0 0 * * 1'
workflow_dispatch:

jobs:
sync-and-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: master

- name: Checkout the upstream repository
uses: actions/checkout@v4
with:
repository: rancher/local-path-provisioner
ref: master
path: upstream

- name: Extract upstream version
id: version-extract
run: |
UPSTREAM_VERSION=$(cat upstream/deploy/chart/local-path-provisioner/Chart.yaml | grep 'version:' | awk '{print $2}')
echo "Upstream version: $UPSTREAM_VERSION"
echo "$UPSTREAM_VERSION=$UPSTREAM_VERSION" >> $GITHUB_ENV

- name: Check if the checked out version is different from current one
id: version-check
run: |
if [ -f "./charts/local-path-provisioner/Chart.yaml" ]; then
CURRENT_VERSION=$(cat charts/local-path-provisioner/Chart.yaml | grep 'version:' | awk '{print $2}')
echo "Current version: $CURRENT_VERSION"

if [ "$CURRENT_VERSION" != "${{ env.UPSTREAM_VERSION }}" ]; then
echo "version_changed=true" >> $GITHUB_ENV
else
echo "version_changed=false" >> $GITHUB_ENV
fi
else
# If Chart.yaml does not exist, treat it as a new version
echo "version_changed=true" >> $GITHUB_ENV
echo "Current version: None"
fi

- name: Copy Helm Chart to my repo
if: env.version_changed == 'true'
run: |
mkdir -p ./charts/local-path-provisioner
# Copy the chart from upstream repo to the charts folder in the current repo
cp -r upstream/deploy/chart/local-path-provisioner/* ./charts/local-path-provisioner/

- name: Create Pull Request
if: env.version_changed == 'true'
uses: peter-evans/create-pull-request@v7
with:
title: "Sync local-path-provisioner Helm chart to version ${{ env.UPSTREAM_VERSION }}"
body: "This PR syncs the latest version of the local-path-provisioner chart from the upstream repository to version ${{ env.UPSTREAM_VERSION }}."
branch: local-path-provisioner
delete-branch: true
commit-message: "Sync local-path-provisioner Helm chart to version ${{ env.UPSTREAM_VERSION }}"
labels: |
automated pr
add-paths: |
charts/local-path-provisioner/**
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### Helm template
# Chart dependencies
**/charts/*.tgz

# Used in CI to check out remotes
upstream/**
3 changes: 1 addition & 2 deletions ct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
remote: origin
chart-dirs:
- charts
chart-repos:
- bitnami=https://charts.bitnami.com/bitnami
target-branch: master
helm-extra-args: --timeout 600s