diff --git a/.gitea/workflows/lint-test.yaml b/.gitea/workflows/lint-test.yaml new file mode 100644 index 0000000..f2d711b --- /dev/null +++ b/.gitea/workflows/lint-test.yaml @@ -0,0 +1,37 @@ +name: lint-and-test-charts + +on: pull_request + +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v4 + with: + version: latest + + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + check-latest: true + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.7.0 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ gitea.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 ${{ gitea.event.repository.default_branch }} diff --git a/.gitea/workflows/release-to-harbor.yml b/.gitea/workflows/release-to-harbor.yml new file mode 100644 index 0000000..00a30ef --- /dev/null +++ b/.gitea/workflows/release-to-harbor.yml @@ -0,0 +1,37 @@ +name: Release Charts +# https://github.com/thpham/helm-oci-charts-releaser + +on: + push: + branches: + - main + paths: + - 'charts/**' + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "${{ gitea.actor }}" + git config user.email "${{ gitea.actor }}@users.noreply.${{ vars.REPOSITORY_HOST }}" + + - name: Run chart-releaser + uses: https://github.com/thpham/helm-oci-charts-releaser@v1 + with: + oci_registry: ${{ vars.REGISTRY_HOST }}/v2/helm-charts + oci_username: ${{ vars.REGISTRY_USER }} + oci_password: ${{ secrets.REGISTRY_SECRET }} + gitea_server: ${{ vars.REPOSITORY_HOST }} + gitea_token: ${{ secrets.REPOSITORY_TOKEN }} + tag_name_pattern: '{chartName}-chart' + skip_existing: true diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml deleted file mode 100644 index 63dd7c5..0000000 --- a/.github/workflows/lint-test.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# name: lint-and-test-charts - -# on: pull_request - -# jobs: -# lint-test: -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# with: -# fetch-depth: 0 - -# - name: Set up Helm -# uses: azure/setup-helm@v4 -# with: -# version: latest - -# - uses: actions/setup-python@v5 -# with: -# python-version: "3.13" -# check-latest: true - -# - name: Set up chart-testing -# uses: helm/chart-testing-action@v2.7.0 - -# - 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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b565f35..9f4e6c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,27 +1,27 @@ -# name: release-charts +name: release-charts -# on: -# push: -# branches: -# - main +on: + push: + branches: + - main -# jobs: -# release: -# permissions: -# contents: write -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# with: -# fetch-depth: 0 +jobs: + release: + permissions: + contents: write + 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 "$GITHUB_ACTOR@users.noreply.github.com" + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" -# - name: Run chart-releaser -# uses: helm/chart-releaser-action@v1.7.0 -# env: -# CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.7.0 + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"