-
Notifications
You must be signed in to change notification settings - Fork 773
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Chart): 📦 add optional separated chart for CRDs
- Loading branch information
1 parent
c6a991d
commit 057783a
Showing
42 changed files
with
16,123 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"template": "## [#{{TO_TAG}}](#{{RELEASE_DIFF}}) (${DATE})\n#{{CHANGELOG}}", | ||
"categories": [ | ||
{ | ||
"title": "## :boom: BREAKING CHANGES", | ||
"rules": [ | ||
{ | ||
"pattern": ".*\\((${REGEXP}).*\\)!:.*", | ||
"on_property": "title", | ||
"flags": "gu" | ||
} | ||
] | ||
}, | ||
{ | ||
"title": "## :rocket: Features", | ||
"rules": [ | ||
{ | ||
"pattern": "feat\\((${REGEXP}).*\\):.*", | ||
"on_property": "title", | ||
"flags": "gu" | ||
} | ||
] | ||
}, | ||
{ | ||
"title": "## :bug: Bug fixes", | ||
"rules": [ | ||
{ | ||
"pattern": "fix\\((${REGEXP}).*\\):.*", | ||
"on_property": "title", | ||
"flags": "gu" | ||
} | ||
] | ||
}, | ||
{ | ||
"title": "## :package: Others", | ||
"rules": [ | ||
{ | ||
"pattern": "(chore|release)\\((${REGEXP}).*\\):.*", | ||
"on_property": "title", | ||
"flags": "gu" | ||
} | ||
] | ||
} | ||
], | ||
"pr_template": "- ${{TITLE}} ##{{NUMBER}} by @#{{AUTHOR}}", | ||
"empty_template": "- no changes", | ||
"transformers": [ | ||
{ | ||
"pattern": "[\\-\\*] (\\[(...|TEST|CI|SKIP)\\])( )?(.+?)\n(.+?[\\-\\*] )(.+)", | ||
"target": "- $4\n - $6" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,13 @@ on: | |
|
||
env: | ||
tag_prefix: v | ||
crds_tag_prefix: crds_v | ||
|
||
jobs: | ||
test: | ||
uses: "traefik/traefik-helm-chart/.github/workflows/test.yml@master" | ||
release: | ||
|
||
traefik: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -27,31 +29,38 @@ jobs: | |
git config user.email "[email protected]" | ||
git config --global --add safe.directory /charts | ||
- name: Copy LICENSE and README.md for packaging | ||
- name: Copy LICENSE, EXAMPLES.md and README.md for packaging | ||
run: | | ||
cp ./README.md ./traefik/README.md | ||
cp ./EXAMPLES.md ./traefik/EXAMPLES.md | ||
cp ./LICENSE ./traefik/LICENSE | ||
- name: Generate default static install | ||
run: | | ||
kustomize build traefik/crds > traefik.yaml | ||
kustomize build traefik-crds > traefik.yaml | ||
helm template traefik ./traefik -n traefik >> traefik.yaml | ||
- name: Get chart verison | ||
- name: Get chart version | ||
id: chart_version | ||
run: | | ||
echo "CHART_VERSION=$(cat traefik/Chart.yaml | awk -F"[ ',]+" '/version:/{print $2}')" >> $GITHUB_OUTPUT | ||
echo "CHART_VERSION=$(cat traefik/Chart.yaml | awk -F"[ ',]+" '/version:/{print $2}' | head -n 1)" >> $GITHUB_OUTPUT | ||
- name: Check if tag exists | ||
id: tag_exists | ||
run: | | ||
TAG_EXISTS=true | ||
if ! [ $(git tag -l "${{ env.tag_prefix }}${{ steps.chart_version.outputs.CHART_VERSION }}") ]; then | ||
TAG_EXISTS=false | ||
TAG_EXISTS=false | ||
if git tag -l | grep "${{ env.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@v1" | ||
with: | ||
prefix: v | ||
if: steps.tag_exists.outputs.TAG_EXISTS == 'false' | ||
|
||
- name: Tag release | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
|
@@ -61,16 +70,40 @@ jobs: | |
tag_prefix: ${{ env.tag_prefix }} | ||
if: steps.tag_exists.outputs.TAG_EXISTS == 'false' | ||
|
||
- name: Render changelog configuration | ||
env: | ||
REGEXP: "?!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@v5 | ||
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@v1 | ||
with: | ||
tag: ${{ steps.tag_version.outputs.new_tag }} | ||
name: ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} | ||
body: ${{ steps.changelog.outputs.changelog }} | ||
prerelease: ${{ contains(steps.chart_version.outputs.CHART_VERSION, '-') }} | ||
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: Publish Helm chart | ||
uses: stefanprodan/helm-gh-pages@master | ||
with: | ||
|
@@ -97,3 +130,113 @@ jobs: | |
registry_username: traefiker | ||
registry_password: ${{ secrets.GHCR_TOKEN }} | ||
if: steps.tag_exists.outputs.TAG_EXISTS == 'false' | ||
|
||
traefik-crds: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
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@v1" | ||
with: | ||
prefix: crds_v | ||
if: steps.tag_exists.outputs.TAG_EXISTS == 'false' | ||
|
||
- name: Tag release | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
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" | ||
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@v5 | ||
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@v1 | ||
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: Publish Helm chart | ||
uses: stefanprodan/helm-gh-pages@master | ||
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: [email protected] | ||
if: steps.tag_exists.outputs.TAG_EXISTS == 'false' | ||
|
||
- name: Publish Helm chart to the ghcr.io registry | ||
uses: appany/[email protected] | ||
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 }} | ||
if: steps.tag_exists.outputs.TAG_EXISTS == 'false' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,11 +23,26 @@ jobs: | |
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Check if values schema is up-to-date | ||
- name: Check traefik if values schema is up-to-date | ||
uses: losisin/helm-values-schema-json-action@v1 | ||
with: | ||
input: traefik/values.yaml | ||
output: traefik/values.schema.json | ||
id: "https://traefik.io/traefik-helm-chart.schema.json" | ||
title: "Traefik Proxy Helm Chart" | ||
description: "The Cloud Native Application Proxy" | ||
additional-properties: true | ||
fail-on-diff: true | ||
|
||
- name: Check traefik-crds if values schema is up-to-date | ||
uses: losisin/helm-values-schema-json-action@v1 | ||
with: | ||
input: traefik-crds/values.yaml | ||
output: traefik-crds/values.schema.json | ||
id: "https://traefik.io/traefik-crds-helm-chart.schema.json" | ||
title: "Traefik CRDs Helm Chart" | ||
description: "The Cloud Native Application Proxy" | ||
additional-properties: false | ||
fail-on-diff: true | ||
|
||
- name: Lint Chart | ||
|
@@ -39,6 +54,9 @@ 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: | | ||
|
@@ -74,7 +92,12 @@ jobs: | |
kubectl wait --namespace metallb-system --for=condition=ready pod --selector=app=metallb --timeout=90s | ||
kubectl apply -f hack/metallb-config.yaml | ||
- name: Check install on Kind | ||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.