Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wzshiming committed Jun 28, 2024
1 parent 50619ef commit a1635ef
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 13 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/chart-lint-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Lint and Test Charts

on:
pull_request:
push:

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.14.4

- uses: actions/setup-python@v5
with:
python-version: '3.x'
check-latest: true

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}
26 changes: 13 additions & 13 deletions .github/workflows/releases-charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Releases Charts

on:
push:
# branches:
# - release-*
# branches:
# - release-*
paths:
- charts/kwok/Chart.yaml
- charts/stage-fast/Chart.yaml
Expand All @@ -23,22 +23,22 @@ jobs:
- name: Install Helm
uses: azure/setup-helm@v4

# - name: Login to GitHub Container Registry
# run: |
# helm registry login --username ${GITHUB_ACTOR} --password ${{ secrets.GITHUB_TOKEN }} ghcr.io
# - name: Release oci charts to ghcr.io
# env:
# IMAGE_PREFIX: ghcr.io/${{ github.repository }}
# run: |
# make oci-charts

- name: Set up Git user
# - name: Login to GitHub Container Registry
# run: |
# helm registry login --username ${GITHUB_ACTOR} --password ${{ secrets.GITHUB_TOKEN }} ghcr.io
# - name: Release oci charts to ghcr.io
# env:
# IMAGE_PREFIX: ghcr.io/${{ github.repository }}
# run: |
# make oci-charts

run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Release charts
uses: helm/[email protected]
# if: ${{ env.PUSH == 'true' }}
# if: ${{ env.PUSH == 'true' }}
env:
CR_RELEASE_NAME_TEMPLATE: "{{ .Name }}-helm-chart-{{ .Version }}"
CR_MAKE_RELEASE_LATEST: false
Expand All @@ -54,5 +54,5 @@ jobs:
if [ -z "${pkg:-}" ]; then
break
fi
helm push "${pkg}" oci://ghcr.io/${{ github.repository }}
helm push "${pkg}" oci://ghcr.io/${{ github.repository }}/charts
done

0 comments on commit a1635ef

Please sign in to comment.