124 lines
3.7 KiB
YAML
124 lines
3.7 KiB
YAML
name: "Charts: Release"
|
|
|
|
concurrency: helm-release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- "charts/**"
|
|
|
|
jobs:
|
|
release-helm:
|
|
runs-on: actions-runner-large
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
|
|
with:
|
|
token: ${{ secrets.BOT_TOKEN }}
|
|
fetch-depth: 0
|
|
|
|
- name: Cache Changelog
|
|
id: cache-changelog
|
|
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
|
|
with:
|
|
path: changelog.json.gz
|
|
key: changelog-json
|
|
|
|
- name: Generate Changelog
|
|
shell: bash
|
|
run: |
|
|
export REPO_PATH="./"
|
|
export TEMPLATE_PATH="./templates/CHANGELOG.md.tmpl"
|
|
export OUTPUT_DIR="./changelogs"
|
|
export JSON_FILE="changelog.json"
|
|
|
|
ls -l
|
|
|
|
if [ -f "$JSON_FILE.gz" ]; then
|
|
gunzip "$JSON_FILE.gz" --force # Force overwrite if file already exists
|
|
fi
|
|
|
|
./charttool genchangelog "$REPO_PATH" "$TEMPLATE_PATH" "$OUTPUT_DIR"
|
|
gzip "$JSON_FILE" --best
|
|
|
|
- name: Checkout Helm-Staging
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
|
|
with:
|
|
fetch-depth: 1
|
|
repository: truecharts/helm-staging
|
|
token: ${{ secrets.BOT_TOKEN }}
|
|
path: helm
|
|
|
|
- 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
|
|
|
|
- name: Commit Helm Changes
|
|
run: |
|
|
rm -rf helm/charts
|
|
mkdir helm/charts
|
|
cp -rf charts helm
|
|
echo "Copying changelogs to helm"
|
|
cp -r ./changelogs/** ./helm/charts/
|
|
|
|
- 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 -
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
|
|
with:
|
|
fetch-depth: 1
|
|
repository: truecharts/website
|
|
token: ${{ secrets.BOT_TOKEN }}
|
|
path: website
|
|
|
|
- name: Copy docs to website
|
|
shell: bash
|
|
run: |
|
|
#!/bin/bash
|
|
CHARTS=(${{ steps.collect-changes.outputs.modifiedChartsAfterTag }})
|
|
echo "Maing sure directories exist..."
|
|
mkdir -p website/public/img/hotlink-ok/chart-icons || echo "chart-icons path already exists, continuing..."
|
|
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
|
|
mv charts.json website/src/assets/charts.json
|
|
|
|
echo "Copying changelogs to docs"
|
|
cp -r ./changelogs/** ./website/src/content/docs/charts/
|
|
|
|
export DEBUG=false
|
|
export STRICT=true
|
|
go-yq --version
|
|
|
|
for i in "${CHARTS[@]}"
|
|
do
|
|
# TODO: Remove any changelog stuff from this script
|
|
# TODO: Move all website docs structure generation to charttool
|
|
./.github/scripts/chart-docs.sh "$i"
|
|
done
|
|
|
|
- name: Commit Website Changes
|
|
run: |
|
|
cd website
|
|
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
|
|
git push
|