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:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-05-09 18:12:13 +00:00
|
|
|
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
|
2023-02-09 13:00:28 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.BOT_TOKEN }}
|
|
|
|
fetch-depth: 1
|
2023-05-07 15:42:53 +00:00
|
|
|
|
2023-02-09 13:00:28 +00:00
|
|
|
- name: Checkout Helm-Staging
|
2024-05-09 18:12:13 +00:00
|
|
|
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # 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
|
|
|
|
2024-02-21 13:28:40 +00:00
|
|
|
- name: Install pre-commit, yamale and yamllint
|
|
|
|
run: |
|
|
|
|
pip3 install --no-cache-dir pre-commit
|
2023-05-07 15:42:53 +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
|
|
|
|
2024-02-25 14:28:04 +00:00
|
|
|
# Optional step if GPG signing is used
|
|
|
|
- name: Clean Questions
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
find ./helm -type f -name 'questions.yaml' -exec rm {} \;
|
|
|
|
|
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
|
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-09-22 12:54:25 +00:00
|
|
|
release-scale:
|
2022-03-30 10:26:37 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-11-10 09:06:50 +00:00
|
|
|
outputs:
|
|
|
|
ref: ${{ steps.save-commit-hash.outputs.commit_hash }}
|
2022-03-30 10:26:37 +00:00
|
|
|
steps:
|
|
|
|
- name: Install Kubernetes tools
|
2024-04-05 06:28:09 +00:00
|
|
|
uses: yokawasa/action-setup-kube-tools@5fe385031665158529decddddb51d6224422836e # v0.11.1
|
2022-03-30 10:26:37 +00:00
|
|
|
with:
|
2022-03-30 12:59:33 +00:00
|
|
|
setup-tools: |
|
|
|
|
helmv3
|
2024-02-14 16:02:56 +00:00
|
|
|
helm: "3.14.0"
|
2022-03-30 10:26:37 +00:00
|
|
|
|
2024-02-14 16:29:01 +00:00
|
|
|
- name: Prep go-yq
|
|
|
|
run: |
|
2024-05-12 16:41:55 +00:00
|
|
|
wget https://github.com/mikefarah/yq/releases/download/v4.44.1/yq_linux_amd64 -O /usr/local/bin/go-yq && chmod +x /usr/local/bin/go-yq
|
2023-05-07 15:42:53 +00:00
|
|
|
|
2023-05-05 17:52:55 +00:00
|
|
|
# Optional step if GPG signing is used
|
|
|
|
- name: Prepare GPG key
|
2023-05-05 20:53:55 +00:00
|
|
|
shell: bash
|
2023-05-05 17:52:55 +00:00
|
|
|
run: |
|
|
|
|
gpg_dir=.cr-gpg
|
2023-05-07 15:42:53 +00:00
|
|
|
mkdir -p "$gpg_dir"
|
2023-05-05 17:52:55 +00: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 09:45:11 +00:00
|
|
|
|
2022-04-01 09:03:57 +00:00
|
|
|
- name: Checkout
|
2024-05-09 18:12:13 +00:00
|
|
|
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
|
2022-04-01 09:03:57 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.BOT_TOKEN }}
|
2022-04-01 10:31:10 +00:00
|
|
|
fetch-depth: 0
|
2024-02-22 00:08:32 +00:00
|
|
|
|
2024-02-21 12:34:30 +00:00
|
|
|
- name: Prep Helm
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
./.github/scripts/prep_helm.sh
|
2022-04-01 07:52:38 +00:00
|
|
|
|
2022-11-24 10:26:33 +00:00
|
|
|
- name: Setting repo parent dir as safe safe.directory
|
|
|
|
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
|
|
|
2022-04-01 07:52:38 +00:00
|
|
|
- name: Collect changes
|
|
|
|
id: collect-changes
|
|
|
|
uses: ./.github/actions/collect-changes
|
|
|
|
|
2022-11-10 19:39:03 +00:00
|
|
|
- name: Generate Changelog
|
2022-04-01 09:34:46 +00:00
|
|
|
shell: bash
|
2022-04-01 09:32:27 +00:00
|
|
|
if: |
|
|
|
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
2022-04-01 09:03:57 +00:00
|
|
|
run: |
|
2024-03-05 12:13:16 +00:00
|
|
|
export GOBIN=/usr/local/bin/
|
2024-02-26 20:15:37 +00:00
|
|
|
go install github.com/git-chglog/git-chglog/cmd/git-chglog@latest
|
2022-04-01 09:32:27 +00:00
|
|
|
CHARTS=(${{ steps.collect-changes.outputs.modifiedChartsAfterTag }})
|
2022-04-03 08:43:00 +00:00
|
|
|
parthreads=$(($(nproc) * 2))
|
2022-11-10 19:39:03 +00:00
|
|
|
parallel -j ${parthreads} .github/scripts/changelog.sh '2>&1' ::: ${CHARTS[@]}
|
2022-04-03 08:43:00 +00:00
|
|
|
|
2022-04-01 09:45:11 +00: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 06:39:13 +00:00
|
|
|
- name: Checkout
|
2024-05-09 18:12:13 +00:00
|
|
|
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
|
2022-04-03 15:15:08 +00:00
|
|
|
if: |
|
|
|
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
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
|
|
|
|
if: |
|
2022-04-01 08:57:40 +00:00
|
|
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
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
|
2022-04-01 08:57:40 +00:00
|
|
|
CHARTS=(${{ steps.collect-changes.outputs.modifiedChartsAfterTag }})
|
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-12 17:57:58 +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
|
|
|
|
2022-04-01 06:56:49 +00:00
|
|
|
for i in "${CHARTS[@]}"
|
|
|
|
do
|
2024-05-12 19:41:41 +00:00
|
|
|
./.github/scripts/chart-docs.sh "$i"
|
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
|
|
|
|
if: |
|
|
|
|
steps.collect-changes.outputs.changesDetected == 'true'
|
|
|
|
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
|
2023-05-07 15:42:53 +00:00
|
|
|
|
2022-11-10 19:39:03 +00:00
|
|
|
- name: Checkout Catalog
|
2024-05-09 18:12:13 +00:00
|
|
|
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
|
2022-04-03 15:15:08 +00:00
|
|
|
if: |
|
2022-04-07 13:25:14 +00:00
|
|
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
2022-04-01 09:03:57 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
repository: truecharts/catalog
|
|
|
|
token: ${{ secrets.BOT_TOKEN }}
|
2022-09-22 12:41:14 +00:00
|
|
|
ref: staging
|
2022-04-01 09:03:57 +00:00
|
|
|
path: catalog
|
|
|
|
|
2022-11-10 19:39:03 +00:00
|
|
|
- name: build catalog
|
2022-04-01 10:03:15 +00:00
|
|
|
shell: bash
|
2022-04-01 08:34:08 +00:00
|
|
|
if: |
|
2022-04-01 08:57:40 +00:00
|
|
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
2022-04-01 08:34:08 +00:00
|
|
|
run: |
|
2022-04-01 09:59:38 +00:00
|
|
|
CHARTS=(${{ steps.collect-changes.outputs.modifiedChartsAfterTag }})
|
2023-12-16 11:59:25 +00:00
|
|
|
./charttool deps
|
2024-02-21 00:22:20 +00:00
|
|
|
./charttool buildSCALE
|
2022-04-03 08:55:01 +00:00
|
|
|
|
2022-04-01 09:59:38 +00: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 20:38:48 +00:00
|
|
|
git commit -sm "Commit new Chart releases for TrueCharts" || exit 0
|
2022-04-02 08:19:14 +00:00
|
|
|
git push
|
2022-04-01 09:59:38 +00:00
|
|
|
cd -
|