Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 3 additions & 142 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ on:

env:
tag_prefix: v
crds_tag_prefix: crds_v

jobs:
traefik:
needs: [ traefik-crds ]
runs-on: ubuntu-latest
steps:

Expand All @@ -35,8 +33,7 @@ jobs:

- name: Generate default static install
run: |
kustomize build traefik-crds > traefik.yaml
helm template traefik ./traefik -n traefik >> traefik.yaml
helm template traefik ./traefik -n traefik > traefik.yaml

- name: Get chart version
id: chart_version
Expand Down Expand Up @@ -70,7 +67,7 @@ jobs:

- name: Render changelog configuration
env:
REGEXP: '(\\(.+\\)|(?!\\(CRDs-.+\\)))'
REGEXP: '(\\(.+\\))'
run: |
export DATE=$(date +%F); cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json; cat /tmp/changelog.json
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'
Expand All @@ -96,12 +93,6 @@ jobs:
artifacts: "traefik.yaml"
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'

# avoid to push both charts
- name: Delete traefik-crds chart
run: |
rm -rf traefik-crds
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
id: gpg
Expand Down Expand Up @@ -154,134 +145,4 @@ jobs:
GH_TOKEN: ${{ secrets.GHCR_TOKEN }}
run: |
gh workflow run -R traefik/hub-doc "🏗️ Sync helm-chart" -F CHART_VERSION=${{ steps.tag_version.outputs.new_tag }}
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'

traefik-crds:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config --global --add safe.directory /charts

- name: Copy LICENSE for packaging
run: |
cp ./LICENSE ./traefik/LICENSE

- name: Get chart version
id: chart_version
run: |
echo "CHART_VERSION=$(cat traefik-crds/Chart.yaml | awk -F"[ ',]+" '/version:/{print $2}' | head -n 1)" >> $GITHUB_OUTPUT

- name: Check if tag exists
id: tag_exists
run: |
TAG_EXISTS=false
if git tag -l | grep '^${{ env.crds_tag_prefix }}${{ steps.chart_version.outputs.CHART_VERSION }}$' > /dev/null ; then
TAG_EXISTS=true
fi
echo TAG_EXISTS=$TAG_EXISTS >> $GITHUB_OUTPUT

- name: Get Previous tag
id: previous_tag
uses: "WyriHaximus/github-action-get-previous-tag@61819f33034117e6c686e6a31dba995a85afc9de" # v2.0.0
with:
pattern: crds_v*
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'

- name: Tag release
id: tag_version
uses: mathieudutour/github-tag-action@a22cf08638b34d5badda920f9daf6e72c477b07b # v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.chart_version.outputs.CHART_VERSION }}
tag_prefix: ${{ env.crds_tag_prefix }}
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'

- name: Render changelog configuration
env:
REGEXP: '\\((CRDs|CRDs-.+)\\)'
run: |
export DATE=$(date +%F); cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json; cat /tmp/changelog.json
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'

- name: Build Changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@a34a8009a9588bb86b02a873cf592440e96a5da8 # v6.1.1
with:
fromTag: ${{ steps.previous_tag.outputs.tag }}
toTag: ${{ steps.tag_version.outputs.new_tag }}
configuration: "/tmp/changelog.json"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'

- name: Create release
uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.changelog.outputs.changelog }}
prerelease: ${{ contains(steps.chart_version.outputs.CHART_VERSION, '-') }}
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'

# avoid to push both charts
- name: Delete traefik chart
run: |
rm -rf traefik
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
id: gpg
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'

- name: Prepare GPG key
run: |
gpg --export > ~/.gnupg/pubring.gpg
gpg --batch --pinentry-mode loopback --yes --passphrase '${{ secrets.GPG_PASSPHRASE }}' --export-secret-key > ~/.gnupg/secring.gpg
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'

- name: Publish Helm chart
uses: bpsoraggi/helm-gh-pages@2a2569e394590687d2c508516af3c9bb9fe7fa7e
with:
token: ${{ secrets.CHARTS_TOKEN }}
charts_dir: .
charts_url: https://traefik.github.io/charts
owner: traefik
repository: charts
branch: master
target_dir: traefik-crds
index_dir: .
commit_username: traefiker
commit_email: 30906710+traefiker@users.noreply.github.com
key: ${{ steps.gpg.outputs.name }}
private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'

- name: Publish Helm chart to the ghcr.io registry
uses: appany/helm-oci-chart-releaser@d94988c92bed2e09c6113981f15f8bb495d10943 # v0.5.0
with:
name: traefik-crds
repository: traefik/helm
tag: ${{ steps.chart_version.outputs.CHART_VERSION }}
path: ./traefik-crds
registry: ghcr.io
registry_username: traefiker
registry_password: ${{ secrets.GHCR_TOKEN }}
sign: true
signing_key: ${{ steps.gpg.outputs.name }}
signing_passphrase: ${{ secrets.GPG_PASSPHRASE }}
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'

if: steps.tag_exists.outputs.TAG_EXISTS == 'false'
41 changes: 2 additions & 39 deletions .github/workflows/test-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
pull_request:
paths:
- .github/fixtures/changelog-traefik.md
- .github/fixtures/changelog-traefik-crds.md
- .github/workflows/changelog.json
- .github/workflows/release.yml

Expand All @@ -18,7 +17,7 @@ jobs:

- name: Render traefik changelog configuration
env:
REGEXP: '(\\(.+\\)|(?!\\(CRDs-.+\\)))'
REGEXP: '(\\(.+\\))'
run: |
export DATE=2025-01-28; cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json; cat /tmp/changelog.json

Expand All @@ -44,40 +43,4 @@ jobs:
old: .github/fixtures/changelog-traefik.md
new: /tmp/changelog.md
mode: strict
tolerance: same

test-crds:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Render traefik changelog configuration
env:
REGEXP: '\\((CRDs|CRDs-.+)\\)'
run: |
export DATE=2025-01-13; cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json; cat /tmp/changelog.json

- name: Build Changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@a34a8009a9588bb86b02a873cf592440e96a5da8 # v6.1.1
with:
fromTag: crds_v1.0.0
toTag: crds_v1.1.0
configuration: "/tmp/changelog.json"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Write changelog
run: |
cat <<EOF > /tmp/changelog.md
${{ steps.changelog.outputs.changelog }}
EOF

- name: Check that the files are the exact same
uses: LouisBrunner/diff-action@9ea7b75986aa27143ad4928974c98a5a1bd92170 # v2.2.0
with:
old: .github/fixtures/changelog-traefik-crds.md
new: /tmp/changelog.md
mode: strict
tolerance: same
tolerance: same
16 changes: 1 addition & 15 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ jobs:
fail-on-diff: true
useHelmDocs: true

- name: Check traefik-crds if values schema is up-to-date
uses: losisin/helm-values-schema-json-action@b0c5e688b224ce7c36fcf005184f1105850d8f3b # v2.4.1
with:
working-directory: traefik-crds
fail-on-diff: true

- name: Lint Chart
run: make lint

Expand All @@ -45,9 +39,6 @@ jobs:
- name: Test overrideNamespace
run: make test-ns

- name: Test CRDs consistency
run: make test-crds-consistency

- name: Test if it's a release PR
id: check
run: |
Expand Down Expand Up @@ -91,9 +82,4 @@ jobs:
- name: Check install on Kind (standard)
if: steps.check.outputs.release
run: |
make test-install

- name: Check install on Kind (with CRDS)
if: steps.check.outputs.release
run: |
make test-install-with-crds
make test-install
5 changes: 1 addition & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ While encouraging contributions, the philosophy leads to avoid introducing:

Commits messages should follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) specification and should specify a scope.

All commits will appear in traefik helm chart changelog with two exceptions:

* CRDs: CRDs are shared between Traefik and CRDs charts, thus, commits with this scope will appear in both charts changelog (e.g. `feat(CRDs): update Traefik Proxy CRDs to v3.x`)
* CRDs-.*: commits with `CRDs-` prefixed scope will appear only on CRDs chart changelog (e.g. `docs(CRDs-values): update values documentation`)
All commits will appear in traefik helm chart changelog.

## About CRDs

Expand Down
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@ IMAGE_HELM_UNITTEST=docker.io/helmunittest/helm-unittest:3.19.0-1.0.1

traefik/tests/__snapshot__:
@mkdir traefik/tests/__snapshot__
@mkdir traefik-crds/tests/__snapshot__

test: traefik/tests/__snapshot__
docker run ${DOCKER_ARGS} --entrypoint /bin/sh --rm -v $(CURDIR):/charts -w /charts $(IMAGE_HELM_UNITTEST) /charts/hack/test.sh

test-ns:
./hack/check-ns.sh

test-crds-consistency:
./hack/check-crds-consistency.sh

lint:
docker run ${DOCKER_ARGS} --env GIT_SAFE_DIR="true" --entrypoint /bin/sh --rm -v $(CURDIR):/charts -w /charts $(IMAGE_CHART_TESTING) /charts/hack/ct.sh lint

Expand All @@ -34,7 +30,6 @@ test-%:
# $ helm plugin install https://github.com/losisin/helm-values-schema-json.git
schema:
cd traefik && helm schema --use-helm-docs
cd traefik-crds && helm schema

changelog:
@echo "== Updating Changelogs..."
Expand Down
19 changes: 9 additions & 10 deletions hack/changelog.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#!/bin/bash

for chart in "./traefik" "./traefik-crds"; do
version=$(yq -r '.version' <"${chart}/Chart.yaml")
changelog="$(sed -e "1,/^## ${version}/d" -e "/^##/,\$d" -e '/^$/d' -e 's/^* /- /' -e 's/^/ /' ${chart}/Changelog.md | grep '^ - ' | sed -e 's/\ *$//g' | sed 's/ - \(.*\)/ - "\1"/g')"
chart="./traefik"
version=$(yq -r '.version' <"${chart}/Chart.yaml")
changelog="$(sed -e "1,/^## ${version}/d" -e "/^##/,\$d" -e '/^$/d' -e 's/^* /- /' -e 's/^/ /' ${chart}/Changelog.md | grep '^ - ' | sed -e 's/\ *$//g' | sed 's/ - \(.*\)/ - "\1"/g')"

echo "${version}"
echo "${changelog}"
echo "${version}"
echo "${changelog}"

sed -i -r 's/^annotations: \{\}/annotations:/g' ${chart}/Chart.yaml
sed -i -e '/^ artifacthub.io\/changes: |/,$d' ${chart}/Chart.yaml
echo " artifacthub.io/changes: |" >>${chart}/Chart.yaml
echo "${changelog}" >>${chart}/Chart.yaml
done
sed -i -r 's/^annotations: \{\}/annotations:/g' ${chart}/Chart.yaml
sed -i -e '/^ artifacthub.io\/changes: |/,$d' ${chart}/Chart.yaml
echo " artifacthub.io/changes: |" >>${chart}/Chart.yaml
echo "${changelog}" >>${chart}/Chart.yaml
40 changes: 0 additions & 40 deletions hack/check-crds-consistency.sh

This file was deleted.

9 changes: 0 additions & 9 deletions hack/ct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,11 @@ ACTION=$1
git config --global --add safe.directory /charts

case "${ACTION}" in
install-with-crds)
ACTION="install"

# deleting existing CRDs
kubectl get customresourcedefinitions.apiextensions.k8s.io -o name | grep traefik.io | xargs kubectl delete crd
ct "${ACTION}" --namespace traefik --config=.github/chart-testing.yaml --charts traefik-crds/
ct "${ACTION}" --namespace traefik --config=.github/chart-testing.yaml --charts traefik/
;;
install)
kubectl create namespace traefik
ct "${ACTION}" --config=.github/chart-testing.yaml --charts traefik/
;;
*)
ct "${ACTION}" --config=.github/chart-testing.yaml --charts traefik-crds/
ct "${ACTION}" --config=.github/chart-testing.yaml --charts traefik/
;;
esac
Loading
Loading