diff --git a/.github/ci/ct.yaml b/.github/ci/ct.yaml new file mode 100644 index 0000000..e2fe382 --- /dev/null +++ b/.github/ci/ct.yaml @@ -0,0 +1,5 @@ +chart-dirs: + - deploy/charts +helm-extra-args: "--timeout=5m" +check-version-increment: false +target-branch: main \ No newline at end of file diff --git a/.github/workflows/ci-chart.yaml b/.github/workflows/ci-chart.yaml index 880baca..dbd884a 100644 --- a/.github/workflows/ci-chart.yaml +++ b/.github/workflows/ci-chart.yaml @@ -3,58 +3,81 @@ name: Helm CI on: push: branches: - - "**" - paths-ignore: - - 'docs/**' - tags: - - "*" + - main + - release-* + paths: + - "deploy/charts/**" pull_request: - paths-ignore: - - 'docs/**' + paths: + - "deploy/charts/**" jobs: - - helm-lint: + helm-lint-test: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v3 + with: + fetch-depth: 0 - - name: Install Helm on Runner + - name: Set up Helm uses: azure/setup-helm@v4.2.0 + with: + version: v3.17.0 - - name: Lint Chart - run: helm lint . - - helm-unitest: - steps: - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/setup-python@v5.3.0 + with: + python-version: "3.x" + check-latest: true - - name: Install Helm on Runner - uses: azure/setup-helm@v4.2.0 + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.7.0 - - name: Lint Chart - run: echo "TODO" + - 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 --config=.github/ci/ct.yaml --target-branch ${{ github.event.repository.default_branch }} + + - name: Create kind cluster + if: steps.list-changed.outputs.changed == 'true' + uses: helm/kind-action@v1.12.0 + + - name: Run chart-testing (install) + if: steps.list-changed.outputs.changed == 'true' + run: ct install --config=.github/ci/ct.yaml --target-branch ${{ github.event.repository.default_branch }} release_helm: runs-on: ubuntu-latest + if: | + github.ref == 'refs/heads/main' || + startsWith(github.ref, 'refs/heads/release-') steps: - name: Checkout uses: actions/checkout@v4 - - - name: Install Helm on Runner - uses: azure/setup-helm@v4.2.0 + with: + fetch-depth: 0 - name: Configure Git run: | git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + - name: Install Helm on Runner + uses: azure/setup-helm@v4.2.0 + + - name: Run chart-releaser uses: helm/chart-releaser-action@v1.6.0 with: charts_dir: deploy/charts skip_existing: true env: - CR_TOKEN: "${{ secrets.CR_TOKEN }}" + CR_RELEASE_NAME_TEMPLATE: "helm-chart-{{ .Version }}" + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/deploy/charts/s3-operator/Chart.yaml b/deploy/charts/s3-operator/Chart.yaml index ff83136..6653750 100644 --- a/deploy/charts/s3-operator/Chart.yaml +++ b/deploy/charts/s3-operator/Chart.yaml @@ -13,9 +13,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.6.0 +version: 0.7.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "1.0.0" +appVersion: "v0.12.0" diff --git a/deploy/charts/s3-operator/values.yaml b/deploy/charts/s3-operator/values.yaml index c8109cd..84abf40 100644 --- a/deploy/charts/s3-operator/values.yaml +++ b/deploy/charts/s3-operator/values.yaml @@ -45,7 +45,7 @@ s3: # allowedNamespaces: "" # Should the operator try to delete the resource from the S3 backend upon CR deletion ? deletion: - bucket: false + bucket: true path: false policy: false s3user: false