mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
c3e91fb357
Signed-off-by: ShutingZhao <shuting@nirmata.com> Signed-off-by: ShutingZhao <shuting@nirmata.com>
81 lines
No EOL
2.6 KiB
YAML
81 lines
No EOL
2.6 KiB
YAML
name: helm-release
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'kyverno-chart-v*'
|
|
- 'kyverno-policies-chart-v*'
|
|
- 'kyverno-chart-*'
|
|
- 'kyverno-policies-chart-*'
|
|
|
|
jobs:
|
|
helm-tests:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0
|
|
|
|
- name: Unshallow
|
|
run: git fetch --prune --unshallow
|
|
|
|
- uses: actions/setup-python@f38219332975fe8f9c04cca981d674bf22aea1d3 # v2.3.1
|
|
with:
|
|
python-version: 3.7
|
|
|
|
- name: Set up chart-testing
|
|
uses: helm/chart-testing-action@b0d4458c71155b54fcf33e11dd465dc923550009 # v2.0.1
|
|
|
|
- name: Run chart-testing (lint)
|
|
run: ct lint --target-branch=main --check-version-increment=false
|
|
|
|
create-release:
|
|
runs-on: ubuntu-latest
|
|
needs: helm-tests
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install Helm
|
|
uses: azure/setup-helm@18bc76811624f360dbd7f18c2d4ecb32c7b87bab # v1.1
|
|
with:
|
|
version: v3.8.0
|
|
|
|
- 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
|
|
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
|
|
|
|
- name: Run chart-releaser
|
|
uses: stefanprodan/helm-gh-pages@b43a8719cc63fdb3aa943cc57359ab19118eab3f #v1.5.0
|
|
with:
|
|
token: "${{ secrets.GITHUB_TOKEN }}"
|
|
linting: off
|
|
charts_dir: charts-tmp
|
|
|
|
- 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}"
|
|
helm package charts-tmp/${chart} --destination dist
|
|
helm push dist/${chart}-*.tgz oci://ghcr.io/${GITHUB_REPOSITORY}
|
|
done |