2024-03-05 16:38:51 +00:00
|
|
|
name: "Charts: Release"
|
2022-03-30 10:26:37 +00:00
|
|
|
|
|
|
|
concurrency: helm-release
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths:
|
|
|
|
- "charts/**"
|
|
|
|
|
|
|
|
jobs:
|
2023-02-09 13:00:28 +00:00
|
|
|
release-helm:
|
2024-05-21 20:48:53 +00:00
|
|
|
runs-on: actions-runner-large
|
2023-02-09 13:00:28 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-06-13 18:16:01 +00:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
|
2023-02-09 13:00:28 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.BOT_TOKEN }}
|
2024-05-31 09:19:36 +00:00
|
|
|
fetch-depth: 0
|
2023-05-07 15:42:53 +00:00
|
|
|
|
2024-06-09 08:51:45 +00:00
|
|
|
- name: Get Changelog Format Version
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
ver=$(./charttool genchangelog format-version)
|
|
|
|
key="changelog-json-format-$ver"
|
|
|
|
echo "Cache Key is: $key"
|
2024-06-10 00:15:07 +00:00
|
|
|
echo "CHANGELOG_CACHE_KEY=$key" >> $GITHUB_ENV
|
2024-06-09 08:51:45 +00:00
|
|
|
|
2024-06-08 23:12:13 +00:00
|
|
|
- name: Cache Changelog
|
2024-05-31 09:36:28 +00:00
|
|
|
id: cache-changelog
|
2024-06-08 23:12:13 +00:00
|
|
|
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
|
2024-05-31 09:36:28 +00:00
|
|
|
with:
|
|
|
|
path: changelog.json.gz
|
2024-06-09 08:51:45 +00:00
|
|
|
key: ${{ env.CHANGELOG_CACHE_KEY }}
|
2024-05-31 09:36:28 +00:00
|
|
|
|
|
|
|
- name: Generate Changelog
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
export REPO_PATH="./"
|
2024-05-31 21:18:40 +00:00
|
|
|
export TEMPLATE_PATH="./templates/CHANGELOG.md.tmpl"
|
|
|
|
export OUTPUT_DIR="./changelogs"
|
2024-05-31 09:36:28 +00:00
|
|
|
export JSON_FILE="changelog.json"
|
2024-05-31 21:48:59 +00:00
|
|
|
|
2024-05-31 09:36:28 +00:00
|
|
|
ls -l
|
2024-05-31 21:18:40 +00:00
|
|
|
|
2024-05-31 09:36:28 +00:00
|
|
|
if [ -f "$JSON_FILE.gz" ]; then
|
|
|
|
gunzip "$JSON_FILE.gz" --force # Force overwrite if file already exists
|
|
|
|
fi
|
|
|
|
|
2024-05-31 21:22:18 +00:00
|
|
|
./charttool genchangelog "$REPO_PATH" "$TEMPLATE_PATH" "$OUTPUT_DIR"
|
2024-05-31 09:36:28 +00:00
|
|
|
gzip "$JSON_FILE" --best
|
|
|
|
|
2023-02-09 13:00:28 +00:00
|
|
|
- name: Checkout Helm-Staging
|
2024-06-13 18:16:01 +00:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
|
2023-02-09 13:00:28 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
repository: truecharts/helm-staging
|
|
|
|
token: ${{ secrets.BOT_TOKEN }}
|
|
|
|
path: helm
|
2024-02-22 00:08:32 +00:00
|
|
|
|
2023-02-09 13:00:28 +00: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 15:42:53 +00:00
|
|
|
|
2023-02-09 13:00:28 +00:00
|
|
|
- name: Commit Helm Changes
|
|
|
|
run: |
|
|
|
|
rm -rf helm/charts
|
|
|
|
mkdir helm/charts
|
2023-02-09 19:19:56 +00:00
|
|
|
cp -rf charts helm
|
2024-05-31 21:29:54 +00:00
|
|
|
echo "Copying changelogs to helm"
|
2024-05-31 21:48:59 +00:00
|
|
|
cp -r ./changelogs/** ./helm/charts/
|
2023-02-09 13:00:28 +00: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-04-01 06:39:13 +00:00
|
|
|
- name: Checkout
|
2024-06-13 18:16:01 +00:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
|
2022-04-01 06:39:13 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
2024-04-16 15:44:04 +00:00
|
|
|
repository: truecharts/website
|
2022-04-01 06:39:13 +00:00
|
|
|
token: ${{ secrets.BOT_TOKEN }}
|
2022-07-12 20:38:48 +00:00
|
|
|
path: website
|
2022-04-01 07:52:38 +00:00
|
|
|
|
2022-04-01 06:34:12 +00:00
|
|
|
- name: Copy docs to website
|
2022-04-01 07:27:52 +00:00
|
|
|
shell: bash
|
2022-04-01 06:34:12 +00:00
|
|
|
run: |
|
2022-04-01 07:17:25 +00:00
|
|
|
#!/bin/bash
|
2024-05-12 17:57:58 +00:00
|
|
|
echo "Maing sure directories exist..."
|
2024-04-13 10:33:15 +00:00
|
|
|
mkdir -p website/public/img/hotlink-ok/chart-icons || echo "chart-icons path already exists, continuing..."
|
2024-04-17 12:17:27 +00:00
|
|
|
mkdir -p website/public/img/hotlink-ok/chart-icons-small || echo "chart-icons-small path already exists, continuing..."
|
2024-05-18 21:57:07 +00:00
|
|
|
mkdir -p website/src/assets || echo "assets path already exists, continuing..."
|
|
|
|
|
|
|
|
./charttool genchartlist ./charts
|
|
|
|
mv charts.json website/src/assets/charts.json
|
2024-05-12 17:57:58 +00:00
|
|
|
|
2024-05-31 21:18:40 +00:00
|
|
|
echo "Copying changelogs to docs"
|
2024-05-31 21:48:59 +00:00
|
|
|
cp -r ./changelogs/** ./website/src/content/docs/charts/
|
2024-05-31 21:18:40 +00:00
|
|
|
|
2024-05-12 22:48:54 +00:00
|
|
|
export DEBUG=false
|
2024-05-12 19:41:41 +00:00
|
|
|
export STRICT=true
|
2024-05-12 19:46:23 +00:00
|
|
|
go-yq --version
|
2024-05-12 19:41:41 +00:00
|
|
|
|
2024-06-09 11:09:19 +00:00
|
|
|
for item in charts/*/*/Chart.yaml; do
|
2024-05-30 14:03:23 +00:00
|
|
|
# TODO: Move all website docs structure generation to charttool
|
2024-06-09 11:09:19 +00:00
|
|
|
IFS='/' read -r -a chart_parts <<<"$item"
|
|
|
|
./.github/scripts/chart-docs.sh "${chart_parts[1]}/${chart_parts[2]}"
|
2022-04-01 06:56:49 +00:00
|
|
|
done
|
2022-04-01 06:34:12 +00:00
|
|
|
|
2022-04-01 10:12:48 +00:00
|
|
|
- name: Commit Website Changes
|
|
|
|
run: |
|
2022-07-12 20:38:48 +00:00
|
|
|
cd website
|
2022-04-01 10:12:48 +00: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 10:42:34 +00:00
|
|
|
git push
|