From 4474374ee19eef2a6e00d3bb4a7aa56547bac6d1 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Mon, 7 Apr 2025 19:42:37 +0200 Subject: [PATCH] chore(ci): replace charttool with clustertool for CI fix(ci): download clustertool during CI setup exclude clustertool-bin --- .github/workflows/charts-lint.yaml | 2 +- .github/workflows/charts-release.yaml | 29 ++++++++++++++++++++++++--- .github/workflows/daily.yaml | 25 ++++++++++++++++++++++- .gitignore | 1 + .pre-commit-config.yaml | 2 +- 5 files changed, 53 insertions(+), 6 deletions(-) diff --git a/.github/workflows/charts-lint.yaml b/.github/workflows/charts-lint.yaml index 571a395721b..05b10e8b48e 100644 --- a/.github/workflows/charts-lint.yaml +++ b/.github/workflows/charts-lint.yaml @@ -105,7 +105,7 @@ jobs: charts_path: "./" run: | CHANGED=$(echo '${{ steps.list-changed.outputs.CHANGED_CHARTS }}' | jq --raw-output '.[]') - ./charttool deps ${CHANGED} + ./clustertool-bin deps ${CHANGED} - name: Run Chart Linting continue-on-error: true diff --git a/.github/workflows/charts-release.yaml b/.github/workflows/charts-release.yaml index c2de03f5114..199df21274b 100644 --- a/.github/workflows/charts-release.yaml +++ b/.github/workflows/charts-release.yaml @@ -58,11 +58,34 @@ jobs: with: fetch-depth: 0 + - name: Install ./clustertool + shell: bash + run: | + VERSION="1.0.4" + FILENAME="clustertool_${VERSION}_linux_amd64.tar.gz" + URL="https://github.com/truecharts/public/releases/download/v${VERSION}/${FILENAME}" + DEST_DIR="./clustertool-bin" + + # Create destination directory if it doesn't exist + mkdir -p "$DEST_DIR" + + # Download the archive + curl -L -o "$FILENAME" "$URL" + + # Extract the archive + tar -xzf "$FILENAME" + + # Move the binary + mv clustertool "$DEST_DIR/" + + # Clean up + rm "$FILENAME" + - name: Get Changelog Format Version shell: bash if: github.event_name == 'push' run: | - ver=$(./charttool genchangelog format-version) + ver=$(./clustertool-bin charts genchangelog format-version) rev="1" key="changelog-format-$ver-rev-$rev" echo "Cache Key is: $key" @@ -96,7 +119,7 @@ jobs: gunzip "$JSON_FILE.gz" --force # Force overwrite if file already exists fi - ./charttool genchangelog "$REPO_PATH" "$TEMPLATE_PATH" "$OUTPUT_DIR" + ./clustertool-bin charts genchangelog "$REPO_PATH" "$TEMPLATE_PATH" "$OUTPUT_DIR" gzip "$JSON_FILE" --best - name: Fix Pre-Commit issues @@ -160,7 +183,7 @@ jobs: mkdir -p website/public/img/hotlink-ok/chart-icons-small || echo "chart-icons-small path already exists, continuing..." mkdir -p website/src/assets || echo "assets path already exists, continuing..." - ./charttool genchartlist ./charts + ./clustertool-bin charts genchartlist ./charts mv charts.json website/src/assets/charts.json echo "Copying changelogs to docs" diff --git a/.github/workflows/daily.yaml b/.github/workflows/daily.yaml index 202e5f5f6da..5941c552cd1 100644 --- a/.github/workflows/daily.yaml +++ b/.github/workflows/daily.yaml @@ -34,6 +34,29 @@ jobs: sudo apt-get -y update sudo apt-get -y install webp + - name: Install ./clustertool + shell: bash + run: | + VERSION="1.0.4" + FILENAME="clustertool_${VERSION}_linux_amd64.tar.gz" + URL="https://github.com/truecharts/public/releases/download/v${VERSION}/${FILENAME}" + DEST_DIR="./clustertool-bin" + + # Create destination directory if it doesn't exist + mkdir -p "$DEST_DIR" + + # Download the archive + curl -L -o "$FILENAME" "$URL" + + # Extract the archive + tar -xzf "$FILENAME" + + # Move the binary + mv clustertool "$DEST_DIR/" + + # Clean up + rm "$FILENAME" + - name: Transcode icons to webp shell: bash run: | @@ -75,7 +98,7 @@ jobs: - name: Fix Chart.yaml shell: bash run: | - ./charttool genmeta + ./clustertool-bin charts genmeta - name: Ensure Go Mod Tidy run: | diff --git a/.gitignore b/.gitignore index 5df25dac835..81bea2c18fd 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ node_modules/ !archive/website !repositories/helm .qodo +clustertool-bin diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 56b10c9c089..5bfc74cc479 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,7 +35,7 @@ repos: - id: requirements-txt-fixer # sorts entries in requirements.txt. exclude: ^archive/ - id: check-added-large-files # prevents giant files from being committed. - exclude: \.(png|jpg|jpeg|svg|yaml|yml|tpl|md)$ + exclude: \.(png|jpg|jpeg|svg|yaml|yml|tpl|md)$|clustertool-bin$ - id: check-yaml # checks yaml files for parseable syntax. exclude: (^archive|^website\/public|templates\/.*|crds\/.*|questions.yaml|chart_schema.yaml|common-test\/.*\.yaml|^clustertool) - id: detect-private-key # detects the presence of private keys.