2021-07-14 19:10:41 +00:00
|
|
|
name: helm-release
|
2023-01-06 15:24:55 +00:00
|
|
|
|
2023-06-30 11:44:57 +00:00
|
|
|
permissions: {}
|
|
|
|
|
2021-07-14 19:10:41 +00:00
|
|
|
on:
|
|
|
|
push:
|
2021-08-20 22:06:58 +00:00
|
|
|
tags:
|
2022-04-27 03:52:45 +00:00
|
|
|
- 'kyverno-chart-v*'
|
|
|
|
- 'kyverno-policies-chart-v*'
|
2022-09-08 17:34:09 +00:00
|
|
|
- 'kyverno-chart-*'
|
|
|
|
- 'kyverno-policies-chart-*'
|
2021-07-14 19:10:41 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-07-21 00:06:56 +00:00
|
|
|
helm-tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-25 07:39:53 +00:00
|
|
|
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
|
2023-09-27 08:24:27 +00:00
|
|
|
- name: Setup caches
|
|
|
|
uses: ./.github/actions/setup-caches
|
|
|
|
timeout-minutes: 5
|
|
|
|
continue-on-error: true
|
2023-01-05 15:52:52 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2023-08-30 20:44:51 +00:00
|
|
|
timeout-minutes: 10
|
2023-07-14 08:21:53 +00:00
|
|
|
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
|
2021-07-21 00:06:56 +00:00
|
|
|
with:
|
|
|
|
python-version: 3.7
|
|
|
|
- name: Set up chart-testing
|
2023-03-27 10:47:32 +00:00
|
|
|
uses: helm/chart-testing-action@e8788873172cb653a90ca2e819d79d65a66d4e76 # v2.4.0
|
2021-07-21 00:06:56 +00:00
|
|
|
- name: Run chart-testing (lint)
|
|
|
|
run: ct lint --target-branch=main --check-version-increment=false
|
|
|
|
|
2023-04-03 07:56:52 +00:00
|
|
|
linter-artifacthub:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: artifacthub/ah
|
|
|
|
options: --user root
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-25 07:39:53 +00:00
|
|
|
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
|
2023-04-03 07:56:52 +00:00
|
|
|
- name: Run ah lint
|
|
|
|
working-directory: ./charts/
|
|
|
|
run: ah lint
|
|
|
|
|
2021-07-14 19:10:41 +00:00
|
|
|
create-release:
|
|
|
|
runs-on: ubuntu-latest
|
2021-07-21 00:06:56 +00:00
|
|
|
needs: helm-tests
|
2022-10-12 20:14:44 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
packages: write
|
|
|
|
id-token: write
|
|
|
|
pages: write
|
2021-07-14 19:10:41 +00:00
|
|
|
steps:
|
2021-07-19 20:01:17 +00:00
|
|
|
- name: Checkout
|
2023-09-25 07:39:53 +00:00
|
|
|
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
|
2023-09-27 08:24:27 +00:00
|
|
|
- name: Setup caches
|
|
|
|
uses: ./.github/actions/setup-caches
|
|
|
|
timeout-minutes: 5
|
|
|
|
continue-on-error: true
|
2023-01-05 15:52:52 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2023-08-30 20:44:51 +00:00
|
|
|
timeout-minutes: 10
|
2022-09-02 08:55:41 +00:00
|
|
|
|
2021-07-14 19:10:41 +00:00
|
|
|
- name: Install Helm
|
2022-12-13 08:23:32 +00:00
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
2021-07-14 19:10:41 +00:00
|
|
|
with:
|
2022-12-27 12:58:18 +00:00
|
|
|
version: v3.10.3
|
2021-07-14 19:10:41 +00:00
|
|
|
|
2022-10-12 20:14:44 +00:00
|
|
|
- name: Install Cosign
|
2023-09-04 12:07:07 +00:00
|
|
|
uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # v3.1.2
|
2022-10-12 20:14:44 +00:00
|
|
|
|
2022-04-27 03:52:45 +00:00
|
|
|
- name: Set version
|
|
|
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Create charts tmp directory
|
|
|
|
run: |
|
|
|
|
mkdir charts-tmp
|
|
|
|
if [[ "$RELEASE_VERSION" = "kyverno-policies-chart-v"* ]]; then
|
|
|
|
cp -a charts/kyverno-policies charts-tmp/kyverno-policies
|
|
|
|
fi
|
|
|
|
if [[ "$RELEASE_VERSION" = "kyverno-chart-v"* ]]; then
|
|
|
|
cp -a charts/kyverno charts-tmp/kyverno
|
|
|
|
fi
|
2022-09-12 07:36:46 +00:00
|
|
|
if [[ "$RELEASE_VERSION" = "kyverno-policies-chart-"* ]]; then
|
|
|
|
cp -a charts/kyverno-policies charts-tmp/kyverno-policies
|
|
|
|
fi
|
|
|
|
if [[ "$RELEASE_VERSION" = "kyverno-chart-"* ]]; then
|
|
|
|
cp -a charts/kyverno charts-tmp/kyverno
|
|
|
|
fi
|
2022-04-27 03:52:45 +00:00
|
|
|
|
2021-07-14 19:10:41 +00:00
|
|
|
- name: Run chart-releaser
|
2022-12-02 12:52:56 +00:00
|
|
|
uses: stefanprodan/helm-gh-pages@0ad2bb377311d61ac04ad9eb6f252fb68e207260 #v1.7.0
|
2021-07-14 19:10:41 +00:00
|
|
|
with:
|
2021-07-20 19:49:37 +00:00
|
|
|
token: "${{ secrets.GITHUB_TOKEN }}"
|
2022-02-21 15:50:42 +00:00
|
|
|
linting: off
|
2022-04-27 03:52:45 +00:00
|
|
|
charts_dir: charts-tmp
|
2022-09-01 19:15:33 +00:00
|
|
|
|
|
|
|
- name: Login to GitHub Container Registry
|
|
|
|
run: |
|
|
|
|
helm registry login --username ${GITHUB_ACTOR} --password ${{ secrets.GITHUB_TOKEN }} ghcr.io
|
|
|
|
|
|
|
|
- name: Publish OCI Charts
|
|
|
|
run: |
|
|
|
|
for dir in `find charts-tmp -maxdepth 1 -mindepth 1 -type d -print`; do
|
|
|
|
chart=${dir##*/}
|
|
|
|
echo "Found chart: ${chart}"
|
2022-10-02 20:20:33 +00:00
|
|
|
helm package charts-tmp/${chart} --destination .dist
|
2022-12-27 12:58:18 +00:00
|
|
|
helm push .dist/${chart}-*.tgz oci://ghcr.io/${{ github.repository_owner }}/charts |& tee .digest
|
2023-06-30 13:40:08 +00:00
|
|
|
cosign login --username ${GITHUB_ACTOR} --password ${{ secrets.GITHUB_TOKEN }} ghcr.io
|
2023-07-06 12:19:21 +00:00
|
|
|
cosign sign --yes ghcr.io/${{ github.repository_owner }}/charts/${chart}@$(cat .digest | awk -F "[, ]+" '/Digest/{print $NF}')
|
2022-10-02 20:20:33 +00:00
|
|
|
done
|