2022-03-30 06:26:37 -04:00
|
|
|
name: "Charts: Release"
|
|
|
|
|
|
|
|
concurrency: helm-release
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths:
|
|
|
|
- "charts/**"
|
|
|
|
|
|
|
|
jobs:
|
2023-02-09 08:00:28 -05:00
|
|
|
release-helm:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
2023-05-05 10:32:00 -04:00
|
|
|
image: ghcr.io/truecharts/devcontainer:3.1.10@sha256:c239addf725eb5cedf79517f8089fdafdc32b5270d1893ee87ae6e511b9bcae3
|
2023-02-09 08:00:28 -05:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-17 13:24:19 -04:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
2023-02-09 08:00:28 -05:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.BOT_TOKEN }}
|
|
|
|
fetch-depth: 1
|
2023-05-07 11:42:53 -04:00
|
|
|
|
2023-02-09 08:00:28 -05:00
|
|
|
- name: Checkout Helm-Staging
|
2023-10-17 13:24:19 -04:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
2023-02-09 08:00:28 -05:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
repository: truecharts/helm-staging
|
|
|
|
token: ${{ secrets.BOT_TOKEN }}
|
|
|
|
path: helm
|
2023-05-07 11:42:53 -04:00
|
|
|
|
2023-02-09 08:00:28 -05:00
|
|
|
- name: Fix Pre-Commit issues
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "Running pre-commit test-and-cleanup..."
|
|
|
|
pre-commit run --all ||:
|
|
|
|
# Fix sh files to always be executable
|
|
|
|
find . -name '*.sh' | xargs chmod +x
|
2023-05-07 11:42:53 -04:00
|
|
|
|
2023-02-09 08:00:28 -05:00
|
|
|
- name: Commit Helm Changes
|
|
|
|
run: |
|
|
|
|
rm -rf helm/charts
|
|
|
|
mkdir helm/charts
|
2023-02-09 14:19:56 -05:00
|
|
|
cp -rf charts helm
|
2023-02-09 08:00:28 -05:00
|
|
|
|
|
|
|
- name: Commit Helm Changes
|
|
|
|
run: |
|
|
|
|
cd helm
|
|
|
|
git config user.name "TrueCharts-Bot"
|
|
|
|
git config user.email "bot@truecharts.org"
|
|
|
|
git add --all
|
|
|
|
git commit -sm "Commit released Helm Charts for TrueCharts" || exit 0
|
|
|
|
git push
|
|
|
|
cd -
|
|
|
|
|
2022-09-22 08:54:25 -04:00
|
|
|
release-scale:
|
2022-03-30 06:26:37 -04:00
|
|
|
runs-on: ubuntu-latest
|
2022-11-10 04:06:50 -05:00
|
|
|
outputs:
|
|
|
|
ref: ${{ steps.save-commit-hash.outputs.commit_hash }}
|
2022-03-30 06:26:37 -04:00
|
|
|
container:
|
2023-05-05 10:32:00 -04:00
|
|
|
image: ghcr.io/truecharts/devcontainer:3.1.10@sha256:c239addf725eb5cedf79517f8089fdafdc32b5270d1893ee87ae6e511b9bcae3
|
2022-03-30 06:26:37 -04:00
|
|
|
steps:
|
|
|
|
- name: Install Kubernetes tools
|
2023-02-21 17:10:54 -05:00
|
|
|
uses: yokawasa/action-setup-kube-tools@af4ebb1af1efd30c5bd84a2e9773355ad6362a33 # v0.9.3
|
2022-03-30 06:26:37 -04:00
|
|
|
with:
|
2022-03-30 08:59:33 -04:00
|
|
|
setup-tools: |
|
|
|
|
helmv3
|
2023-11-12 18:12:58 -05:00
|
|
|
helm: "3.13.2"
|
2022-03-30 06:26:37 -04:00
|
|
|
|
2022-04-01 05:45:11 -04:00
|
|
|
- name: Prep Helm
|
|
|
|
run: |
|
|
|
|
helm repo add truecharts https://charts.truecharts.org
|
|
|
|
helm repo add truecharts-library https://library-charts.truecharts.org
|
2023-05-15 05:36:00 -04:00
|
|
|
helm repo add truecharts-deps https://deps.truecharts.org
|
2023-07-15 13:22:49 -04:00
|
|
|
helm repo add jetstack https://charts.jetstack.io
|
2023-11-15 09:39:03 -05:00
|
|
|
helm repo add vmwaretanzu https://vmware-tanzu.github.io/helm-charts
|
|
|
|
helm repo add cnpg https://cloudnative-pg.github.io/charts
|
|
|
|
helm repo add metallb https://metallb.github.io/metallb
|
2022-04-01 05:45:11 -04:00
|
|
|
helm repo update
|
2023-05-07 11:42:53 -04:00
|
|
|
|
2023-05-05 13:52:55 -04:00
|
|
|
# Optional step if GPG signing is used
|
|
|
|
- name: Prepare GPG key
|
2023-05-05 16:53:55 -04:00
|
|
|
shell: bash
|
2023-05-05 13:52:55 -04:00
|
|
|
run: |
|
|
|
|
gpg_dir=.cr-gpg
|
2023-05-07 11:42:53 -04:00
|
|
|
mkdir -p "$gpg_dir"
|
2023-05-05 13:52:55 -04:00
|
|
|
keyring="$gpg_dir/secring.gpg"
|
|
|
|
base64 -d <<< "$GPG_KEYRING_BASE64" > "$keyring"
|
|
|
|
passphrase_file="$gpg_dir/passphrase"
|
|
|
|
echo "$GPG_PASSPHRASE" > "$passphrase_file"
|
|
|
|
echo "CR_PASSPHRASE_FILE=$passphrase_file" >> "$GITHUB_ENV"
|
|
|
|
echo "CR_KEYRING=$keyring" >> "$GITHUB_ENV"
|
|
|
|
env:
|
|
|
|
GPG_KEYRING_BASE64: "${{ secrets.GPG_KEYRING_BASE64 }}"
|
|
|
|
GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}"
|
2022-04-01 05:45:11 -04:00
|
|
|
|
2022-04-01 05:03:57 -04:00
|
|
|
- name: Checkout
|
2023-10-17 13:24:19 -04:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
2022-04-01 05:03:57 -04:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.BOT_TOKEN }}
|
2022-04-01 06:31:10 -04:00
|
|
|
fetch-depth: 0
|
2022-04-01 03:52:38 -04:00
|
|
|
|
2022-11-24 05:26:33 -05:00
|
|
|
- name: Setting repo parent dir as safe safe.directory
|
|
|
|
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
|
|
|
2022-04-01 03:52:38 -04:00
|
|
|
- name: Collect changes
|
|
|
|
id: collect-changes
|
|
|
|
uses: ./.github/actions/collect-changes
|
|
|
|
|
2022-11-10 14:39:03 -05:00
|
|
|
- name: Generate Changelog
|
2022-04-01 05:34:46 -04:00
|
|
|
shell: bash
|
2022-04-01 05:32:27 -04:00
|
|
|
if: |
|
|
|
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
2022-04-01 05:03:57 -04:00
|
|
|
run: |
|
2022-04-01 05:32:27 -04:00
|
|
|
CHARTS=(${{ steps.collect-changes.outputs.modifiedChartsAfterTag }})
|
2022-04-03 04:43:00 -04:00
|
|
|
parthreads=$(($(nproc) * 2))
|
2022-11-10 14:39:03 -05:00
|
|
|
parallel -j ${parthreads} .github/scripts/changelog.sh '2>&1' ::: ${CHARTS[@]}
|
2022-04-03 04:43:00 -04:00
|
|
|
|
2022-04-01 05:45:11 -04:00
|
|
|
- name: Fix Pre-Commit issues
|
|
|
|
shell: bash
|
|
|
|
if: |
|
|
|
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
|
|
|
run: |
|
|
|
|
echo "Running pre-commit test-and-cleanup..."
|
|
|
|
pre-commit run --all ||:
|
|
|
|
# Fix sh files to always be executable
|
|
|
|
find . -name '*.sh' | xargs chmod +x
|
|
|
|
|
2022-04-01 02:39:13 -04:00
|
|
|
- name: Checkout
|
2023-10-17 13:24:19 -04:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
2022-04-03 11:15:08 -04:00
|
|
|
if: |
|
|
|
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
2022-04-01 02:39:13 -04:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
2022-07-12 16:38:48 -04:00
|
|
|
repository: truecharts/website
|
2022-04-01 02:39:13 -04:00
|
|
|
token: ${{ secrets.BOT_TOKEN }}
|
2022-07-12 16:38:48 -04:00
|
|
|
path: website
|
2022-04-01 03:52:38 -04:00
|
|
|
|
2022-04-01 02:34:12 -04:00
|
|
|
- name: Copy docs to website
|
|
|
|
if: |
|
2022-04-01 04:57:40 -04:00
|
|
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
2022-04-01 03:27:52 -04:00
|
|
|
shell: bash
|
2022-04-01 02:34:12 -04:00
|
|
|
run: |
|
2022-04-01 03:17:25 -04:00
|
|
|
#!/bin/bash
|
2022-04-01 04:57:40 -04:00
|
|
|
CHARTS=(${{ steps.collect-changes.outputs.modifiedChartsAfterTag }})
|
2022-07-12 18:05:07 -04:00
|
|
|
echo "Removing Chart Docs prior to regeneration..."
|
2022-08-01 16:54:37 -04:00
|
|
|
mkdir -p website/static/img/hotlink-ok/chart-icons || echo "chart-icons path already exists, continuing..."
|
2022-04-01 02:56:49 -04:00
|
|
|
for i in "${CHARTS[@]}"
|
|
|
|
do
|
|
|
|
IFS='/' read -r -a chart_parts <<< "$i"
|
|
|
|
if [ -f "charts/${chart_parts[0]}"/"${chart_parts[1]}/Chart.yaml" ]; then
|
|
|
|
train=${chart_parts[0]}
|
|
|
|
chart=${chart_parts[1]}
|
|
|
|
echo "copying docs to website for ${chart}"
|
2022-12-22 11:19:31 -05:00
|
|
|
mkdir -p website/docs/charts/${train}/${chart} || echo "chart path already exists, continuing..."
|
2022-11-10 15:44:54 -05:00
|
|
|
mkdir -p tmp/website/docs/charts/${train}/${chart}/ || echo "chart path already exists, continuing..."
|
2022-12-18 15:39:57 -05:00
|
|
|
if [[ -f "website/docs/charts/${train}/${chart}/CHANGELOG.md" ]]; then
|
|
|
|
echo "changelog found..."
|
|
|
|
true
|
|
|
|
else
|
|
|
|
echo "changelog not found, starting with empty changelog..."
|
|
|
|
touch "website/docs/charts/${train}/${chart}/CHANGELOG.md"
|
|
|
|
fi
|
2022-12-21 16:55:18 -05:00
|
|
|
if [[ -f "website/docs/charts/${train}/${chart}/helm-security.md" ]]; then
|
|
|
|
echo "helm-security found..."
|
|
|
|
true
|
|
|
|
else
|
|
|
|
echo "helm-security not found, starting with empty helm-security..."
|
|
|
|
touch "website/docs/charts/${train}/${chart}/helm-security.md"
|
2023-12-31 09:24:05 -05:00
|
|
|
(
|
|
|
|
echo "---"
|
|
|
|
echo "title: Helm Security"
|
|
|
|
echo "---"
|
|
|
|
) > website/docs/charts/${train}/${chart}/helm-security.md
|
2022-12-21 16:55:18 -05:00
|
|
|
fi
|
|
|
|
if [[ -f "website/docs/charts/${train}/${chart}/container-security.md" ]]; then
|
|
|
|
echo "container-security found..."
|
|
|
|
true
|
|
|
|
else
|
|
|
|
echo "container-security not found, starting with empty container-security..."
|
|
|
|
touch "website/docs/charts/${train}/${chart}/container-security.md"
|
2023-12-31 09:24:05 -05:00
|
|
|
(
|
|
|
|
echo "---"
|
|
|
|
echo "title: Container Security"
|
|
|
|
echo "---"
|
|
|
|
) > website/docs/charts/${train}/${chart}/container-security.md
|
2022-12-21 16:55:18 -05:00
|
|
|
fi
|
2023-12-31 09:51:16 -05:00
|
|
|
|
|
|
|
echo "Keeping some docs safe..."
|
2022-12-21 16:55:18 -05:00
|
|
|
# keep some docs safe
|
2022-11-10 16:44:16 -05:00
|
|
|
mv -f website/docs/charts/${train}/${chart}/CHANGELOG.md tmp/website/docs/charts/${train}/${chart}/CHANGELOG.md || :
|
2022-12-21 17:13:59 -05:00
|
|
|
mv -f website/docs/charts/${train}/${chart}/helm-security.md tmp/website/docs/charts/${train}/${chart}/helm-security.md || :
|
2022-12-21 17:03:18 -05:00
|
|
|
mv -f website/docs/charts/${train}/${chart}/container-security.md tmp/website/docs/charts/${train}/${chart}/container-security.md || :
|
2023-01-17 18:06:10 -05:00
|
|
|
|
2023-12-31 09:51:16 -05:00
|
|
|
echo "Removing old docs and recreating based on charts repo..."
|
2022-12-21 16:55:18 -05:00
|
|
|
# remove old docs everywhere and recreate based on charts repo
|
2022-11-10 15:44:54 -05:00
|
|
|
rm -rf website/docs/charts/*/${chart} || :
|
2022-07-12 16:38:48 -04:00
|
|
|
mkdir -p website/docs/charts/${train}/${chart} || echo "chart path already exists, continuing..."
|
|
|
|
yes | cp -rf charts/${train}/${chart}/docs/* website/docs/charts/${train}/${chart}/ 2>/dev/null || :
|
2022-12-21 16:55:18 -05:00
|
|
|
yes | cp -rf charts/${train}/${chart}/icon.png website/static/img/hotlink-ok/chart-icons/${chart}.png 2>/dev/null || :
|
2023-06-13 03:56:52 -04:00
|
|
|
yes | cp -rf charts/${train}/${chart}/screenshots/* website/static/img/hotlink-ok/chart-screenshots/${chart}/ 2>/dev/null || :
|
2023-01-17 18:06:10 -05:00
|
|
|
|
2023-12-31 09:51:16 -05:00
|
|
|
echo "Copying back kept docs..."
|
2022-12-21 16:55:18 -05:00
|
|
|
# Copy over kept documents
|
|
|
|
mv -f tmp/website/docs/charts/${train}/${chart}/CHANGELOG.md website/docs/charts/${train}/${chart}/CHANGELOG.md 2>/dev/null || :
|
2022-12-21 17:03:18 -05:00
|
|
|
mv -f tmp/website/docs/charts/${train}/${chart}/helm-security.md website/docs/charts/${train}/${chart}/helm-security.md 2>/dev/null || :
|
|
|
|
mv -f tmp/website/docs/charts/${train}/${chart}/container-security.md website/docs/charts/${train}/${chart}/container-security.md 2>/dev/null || :
|
2022-12-21 16:55:18 -05:00
|
|
|
|
2023-12-31 09:51:16 -05:00
|
|
|
echo "Appending SCALE changelog to actual changelog..."
|
2022-12-21 16:55:18 -05:00
|
|
|
# Append SCALE changelog to actual changelog
|
|
|
|
sed -i '1d' "website/docs/charts/${train}/${chart}/CHANGELOG.md" || echo "failed to sed 1d changelog..."
|
|
|
|
cat "charts/${train}/${chart}/app-changelog.md" | cat - "website/docs/charts/${train}/${chart}/CHANGELOG.md" > temp && mv temp "website/docs/charts/${train}/${chart}/CHANGELOG.md"
|
2023-12-31 12:36:49 -05:00
|
|
|
if grep -q "---\ntitle: Changelog\n---\n\n" "website/docs/charts/${train}/${chart}/CHANGELOG.md"; then
|
2023-12-31 12:29:04 -05:00
|
|
|
echo "changelog header already exists..."
|
|
|
|
else
|
|
|
|
echo "Adding changelog header..."
|
|
|
|
sed -i '1s/^/---\ntitle: Changelog\n---\n\n/' "website/docs/charts/${train}/${chart}/CHANGELOG.md" || echo "failed to add changelog header..."
|
|
|
|
fi
|
2022-12-18 15:29:53 -05:00
|
|
|
|
2023-12-31 09:51:16 -05:00
|
|
|
echo "Creating index.md..."
|
2022-12-17 15:03:55 -05:00
|
|
|
touch website/docs/charts/${train}/${chart}/index.md
|
2023-12-31 09:24:05 -05:00
|
|
|
(
|
|
|
|
echo "---"
|
|
|
|
echo "title: ${chart}"
|
|
|
|
echo "---"
|
|
|
|
) >> website/docs/charts/${train}/${chart}/index.md
|
2022-12-17 15:03:55 -05:00
|
|
|
echo "" >> website/docs/charts/${train}/${chart}/index.md
|
2022-12-21 16:44:24 -05:00
|
|
|
version=$(cat charts/${train}/${chart}/Chart.yaml | grep "^version: " | awk -F" " '{ print $2 }')
|
|
|
|
appversion=$(cat charts/${train}/${chart}/Chart.yaml | grep "^appVersion: " | awk -F" " '{ print $2 }')
|
|
|
|
echo '![Version: '"${version}"'](https://img.shields.io/badge/Version-'"${version}"'-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: '"${appversion}"'](https://img.shields.io/badge/AppVersion-'"${appversion}"'-informational?style=flat-square)' >> website/docs/charts/${train}/${chart}/index.md
|
2022-12-17 15:03:55 -05:00
|
|
|
echo "" >> website/docs/charts/${train}/${chart}/index.md
|
|
|
|
cat charts/${train}/${chart}/Chart.yaml | yq .description -r >> website/docs/charts/${train}/${chart}/index.md
|
|
|
|
echo "" >> website/docs/charts/${train}/${chart}/index.md
|
2023-10-01 12:13:03 -04:00
|
|
|
echo "## Chart Sources" >> website/docs/charts/${train}/${chart}/index.md
|
|
|
|
echo "" >> website/docs/charts/${train}/${chart}/index.md
|
2023-10-02 12:13:43 -04:00
|
|
|
cat charts/${train}/${chart}/Chart.yaml | go-yq .sources -r >> website/docs/charts/${train}/${chart}/index.md
|
2023-10-01 12:13:03 -04:00
|
|
|
echo "" >> website/docs/charts/${train}/${chart}/index.md
|
2022-12-17 15:03:55 -05:00
|
|
|
echo "## Available Documentation" >> website/docs/charts/${train}/${chart}/index.md
|
|
|
|
echo "" >> website/docs/charts/${train}/${chart}/index.md
|
2022-12-18 15:29:53 -05:00
|
|
|
|
2023-12-31 09:51:16 -05:00
|
|
|
echo "Iterating over all files in the docs directory..."
|
2022-12-17 15:03:55 -05:00
|
|
|
# Iterate over all files in the docs directory
|
2022-12-18 15:29:53 -05:00
|
|
|
for file in website/docs/charts/${train}/${chart}/*.md; do
|
2022-12-17 15:03:55 -05:00
|
|
|
# Extract the file name and first line from each file
|
|
|
|
filename=$(basename "${file}")
|
2023-12-31 09:58:52 -05:00
|
|
|
echo "Found doc file: ${file}"
|
2023-12-31 11:32:55 -05:00
|
|
|
ok_title="false"
|
|
|
|
echo "Getting the first line"
|
|
|
|
h=$(head -n 1 "${file}")
|
|
|
|
echo "The first line is: ${h}"
|
|
|
|
# Check if the first line has ---
|
|
|
|
if [[ "${h}" == "---" ]]; then
|
|
|
|
echo "First line is ---, continuing..."
|
|
|
|
ok_title="true"
|
|
|
|
elif [[ "${h}" == "# "* ]]; then
|
|
|
|
echo "First line is #..."
|
|
|
|
ok_title="false"
|
|
|
|
fi
|
|
|
|
if [ ${ok_title} == "false" ]; then
|
2023-12-31 10:16:24 -05:00
|
|
|
echo "Doc title should use front matter and not # for title, for example"
|
|
|
|
echo "---"
|
2023-12-31 11:32:55 -05:00
|
|
|
echo "title: some title"
|
2023-12-31 10:16:24 -05:00
|
|
|
echo "---"
|
2023-12-31 11:26:56 -05:00
|
|
|
exit 99
|
2023-12-31 10:16:24 -05:00
|
|
|
fi
|
2023-12-31 11:26:56 -05:00
|
|
|
echo "Not bad title found, continuing..."
|
2023-12-31 09:24:05 -05:00
|
|
|
title=$(cat "${file}" | grep "title: " | sed 's/title: //')
|
2023-12-31 09:58:52 -05:00
|
|
|
echo "The title is: ${title}"
|
2022-12-17 15:03:55 -05:00
|
|
|
# Create a markdown link using the file name and title
|
2023-12-31 11:04:07 -05:00
|
|
|
link="[**${title}**](./${filename})"
|
2022-12-17 16:55:57 -05:00
|
|
|
if [ ${filename} != "index.md" ]; then
|
|
|
|
# Append the link to the index.md file
|
2022-12-21 17:05:13 -05:00
|
|
|
echo "- ${link}" >> website/docs/charts/${train}/${chart}/index.md
|
2022-12-19 17:20:06 -05:00
|
|
|
echo "" >> website/docs/charts/${train}/${chart}/index.md
|
2022-12-17 16:55:57 -05:00
|
|
|
fi
|
2022-12-17 15:03:55 -05:00
|
|
|
done
|
2022-12-18 15:29:53 -05:00
|
|
|
|
2022-11-10 15:44:54 -05:00
|
|
|
rm -rf temp || :
|
2022-04-01 02:56:49 -04:00
|
|
|
fi
|
|
|
|
done
|
2022-04-01 02:34:12 -04:00
|
|
|
|
2022-04-01 06:12:48 -04:00
|
|
|
- name: Commit Website Changes
|
|
|
|
if: |
|
|
|
|
steps.collect-changes.outputs.changesDetected == 'true'
|
|
|
|
run: |
|
2022-07-12 16:38:48 -04:00
|
|
|
cd website
|
2022-04-01 06:12:48 -04:00
|
|
|
git config user.name "TrueCharts-Bot"
|
|
|
|
git config user.email "bot@truecharts.org"
|
|
|
|
git add --all
|
|
|
|
git commit -sm "Commit released docs for TrueCharts" || exit 0
|
2022-04-01 06:42:34 -04:00
|
|
|
git push
|
2023-05-07 11:42:53 -04:00
|
|
|
|
2022-11-10 14:39:03 -05:00
|
|
|
- name: Checkout Catalog
|
2023-10-17 13:24:19 -04:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
2022-04-03 11:15:08 -04:00
|
|
|
if: |
|
2022-04-07 09:25:14 -04:00
|
|
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
2022-04-01 05:03:57 -04:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
repository: truecharts/catalog
|
|
|
|
token: ${{ secrets.BOT_TOKEN }}
|
2022-09-22 08:41:14 -04:00
|
|
|
ref: staging
|
2022-04-01 05:03:57 -04:00
|
|
|
path: catalog
|
|
|
|
|
2022-11-10 14:39:03 -05:00
|
|
|
- name: build catalog
|
2022-04-01 06:03:15 -04:00
|
|
|
shell: bash
|
2022-04-01 04:34:08 -04:00
|
|
|
if: |
|
2022-04-01 04:57:40 -04:00
|
|
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
2022-04-01 04:34:08 -04:00
|
|
|
run: |
|
2022-04-01 05:59:38 -04:00
|
|
|
CHARTS=(${{ steps.collect-changes.outputs.modifiedChartsAfterTag }})
|
2023-12-16 06:59:25 -05:00
|
|
|
./charttool deps
|
2022-11-12 10:04:04 -05:00
|
|
|
pip install yq
|
2022-04-03 04:55:01 -04:00
|
|
|
parthreads=$(($(nproc) * 2))
|
|
|
|
parallel -j ${parthreads} .github/scripts/build-catalog.sh '2>&1' ::: ${CHARTS[@]}
|
2022-12-01 06:56:51 -05:00
|
|
|
rm -rf website
|
2022-04-03 04:55:01 -04:00
|
|
|
|
2022-04-01 05:59:38 -04:00
|
|
|
- name: Commit Catalog
|
|
|
|
if: |
|
|
|
|
steps.collect-changes.outputs.changesDetected == 'true'
|
|
|
|
run: |
|
|
|
|
cd catalog
|
|
|
|
git config user.name "TrueCharts-Bot"
|
|
|
|
git config user.email "bot@truecharts.org"
|
|
|
|
git add --all
|
2022-07-12 16:38:48 -04:00
|
|
|
git commit -sm "Commit new Chart releases for TrueCharts" || exit 0
|
2022-04-02 04:19:14 -04:00
|
|
|
git push
|
2022-04-01 05:59:38 -04:00
|
|
|
cd -
|
|
|
|
rm -rf catalog
|
2022-11-12 10:58:44 -05:00
|
|
|
|
2022-11-11 14:01:23 -05:00
|
|
|
- name: set git author
|
|
|
|
if: |
|
|
|
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
git config user.name "TrueCharts-Bot"
|
|
|
|
git config user.email "bot@truecharts.org"
|
2023-05-07 11:42:53 -04:00
|
|
|
|
2023-05-05 17:02:07 -04:00
|
|
|
# Optional step if GPG signing is used
|
|
|
|
- name: Prepare GPG key
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
gpg_dir=.cr-gpg
|
2023-05-07 11:42:53 -04:00
|
|
|
mkdir -p "$gpg_dir"
|
2023-05-05 17:02:07 -04:00
|
|
|
keyring="$gpg_dir/secring.gpg"
|
|
|
|
base64 -d <<< "$GPG_KEYRING_BASE64" > "$keyring"
|
|
|
|
passphrase_file="$gpg_dir/passphrase"
|
|
|
|
echo "$GPG_PASSPHRASE" > "$passphrase_file"
|
|
|
|
echo "CR_PASSPHRASE_FILE=$passphrase_file" >> "$GITHUB_ENV"
|
|
|
|
echo "CR_KEYRING=$keyring" >> "$GITHUB_ENV"
|
|
|
|
env:
|
|
|
|
GPG_KEYRING_BASE64: "${{ secrets.GPG_KEYRING_BASE64 }}"
|
|
|
|
GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}"
|
2023-05-07 11:42:53 -04:00
|
|
|
|
2022-11-11 13:30:43 -05:00
|
|
|
- name: Run chart-releaser for dependency apps
|
2023-11-02 14:31:00 -04:00
|
|
|
uses: helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # v1.6.0
|
2022-11-11 13:30:43 -05:00
|
|
|
if: |
|
|
|
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
|
|
|
with:
|
|
|
|
charts_dir: charts/dependency
|
2023-02-10 04:44:48 -05:00
|
|
|
charts_repo_url: https://deps.truecharts.org
|
2023-05-05 06:42:30 -04:00
|
|
|
config: cr.yaml
|
2022-11-11 13:30:43 -05:00
|
|
|
env:
|
|
|
|
CR_TOKEN: "${{ secrets.BOT_TOKEN }}"
|
|
|
|
CR_SKIP_EXISTING: "true"
|
2022-11-12 10:58:44 -05:00
|
|
|
|
2022-11-11 13:51:04 -05:00
|
|
|
- name: Tag App Releases
|
|
|
|
if: |
|
|
|
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
2022-11-10 04:06:50 -05:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-11-11 13:51:04 -05:00
|
|
|
#!/bin/bash
|
|
|
|
CHARTS=(${{ steps.collect-changes.outputs.modifiedChartsAfterTag }})
|
|
|
|
echo "Removing Chart Docs prior to regeneration..."
|
|
|
|
mkdir -p website/static/img/hotlink-ok/chart-icons || echo "chart-icons path already exists, continuing..."
|
|
|
|
for i in "${CHARTS[@]}"
|
|
|
|
do
|
|
|
|
IFS='/' read -r -a chart_parts <<< "$i"
|
|
|
|
if [ -f "charts/${chart_parts[0]}"/"${chart_parts[1]}/Chart.yaml" ]; then
|
|
|
|
train=${chart_parts[0]}
|
|
|
|
chart=${chart_parts[1]}
|
|
|
|
if [ "${train}" != "dependency" ]; then
|
|
|
|
echo "creating tag for ${chart}"
|
|
|
|
version=$(cat charts/${train}/${chart}/Chart.yaml | grep '^version: ' | awk -F" " '{ print $2 }' | head -1)
|
2022-11-20 14:45:32 -05:00
|
|
|
git tag ${chart}-${version} || echo "tag failed for ${chart}-${version}"
|
2022-11-11 13:51:04 -05:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
git push --tags
|