2020-12-22 19:12:39 +00:00
|
|
|
name: Helm
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-02-18 10:27:10 +00:00
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- release-*
|
2020-12-22 19:12:39 +00:00
|
|
|
paths:
|
|
|
|
- 'deploy/charts/**'
|
2024-02-17 09:49:21 +00:00
|
|
|
- 'deploy/crds/**'
|
2020-12-22 19:12:39 +00:00
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'deploy/charts/**'
|
2024-02-17 09:49:21 +00:00
|
|
|
- 'deploy/crds/**'
|
2021-02-18 10:27:10 +00:00
|
|
|
workflow_dispatch: {}
|
2020-12-22 19:12:39 +00:00
|
|
|
|
2024-01-18 20:03:07 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-12-22 19:12:39 +00:00
|
|
|
jobs:
|
|
|
|
lint-and-test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-06-17 15:53:09 +00:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2020-12-22 19:12:39 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Generate chart
|
|
|
|
run: |
|
2021-02-18 10:27:10 +00:00
|
|
|
make helm.generate
|
2020-12-22 19:12:39 +00:00
|
|
|
- name: Set up Helm
|
2024-01-18 20:03:07 +00:00
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
2020-12-22 19:12:39 +00:00
|
|
|
with:
|
2024-03-27 12:49:32 +00:00
|
|
|
version: v3.14.2 # remember to also update for the second job (release)
|
2020-12-22 19:12:39 +00:00
|
|
|
|
2024-07-15 10:43:47 +00:00
|
|
|
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
|
2020-12-22 19:12:39 +00:00
|
|
|
with:
|
|
|
|
python-version: 3.7
|
|
|
|
|
|
|
|
- name: Set up chart-testing
|
2024-01-18 20:03:07 +00:00
|
|
|
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
|
2020-12-22 19:12:39 +00:00
|
|
|
|
|
|
|
- name: Run chart-testing (list-changed)
|
|
|
|
id: list-changed
|
|
|
|
run: |
|
|
|
|
changed=$(ct list-changed --config=.github/ci/ct.yaml)
|
|
|
|
if [[ -n "$changed" ]]; then
|
2023-12-21 21:30:54 +00:00
|
|
|
echo "changed=true" >> $GITHUB_OUTPUT
|
2020-12-22 19:12:39 +00:00
|
|
|
fi
|
2023-03-16 00:05:03 +00:00
|
|
|
- name: Install chart unittest
|
|
|
|
run: |
|
|
|
|
helm env
|
|
|
|
helm plugin install https://github.com/helm-unittest/helm-unittest
|
2020-12-22 19:12:39 +00:00
|
|
|
- name: Run chart-testing (lint)
|
|
|
|
run: ct lint --config=.github/ci/ct.yaml
|
|
|
|
|
2023-03-16 00:05:03 +00:00
|
|
|
- name: Create kind cluster
|
2024-04-30 16:36:25 +00:00
|
|
|
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
|
2023-03-16 00:05:03 +00:00
|
|
|
if: steps.list-changed.outputs.changed == 'true'
|
|
|
|
|
|
|
|
- name: Run chart-testing (install)
|
|
|
|
run: ct install --config=.github/ci/ct.yaml --charts deploy/charts/external-secrets
|
|
|
|
if: steps.list-changed.outputs.changed == 'true'
|
|
|
|
|
|
|
|
- name: Run unitests
|
|
|
|
if: steps.list-changed.outputs.changed == 'true'
|
|
|
|
run: make helm.test
|
|
|
|
|
2021-04-30 22:23:51 +00:00
|
|
|
release:
|
2024-01-18 20:03:07 +00:00
|
|
|
permissions:
|
|
|
|
contents: write # for helm/chart-releaser-action to push chart release and create a release
|
2024-03-27 12:49:32 +00:00
|
|
|
packages: write # to push OCI chart package to GitHub Registry
|
2021-04-30 22:23:51 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-06-17 15:53:09 +00:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2021-04-30 22:23:51 +00:00
|
|
|
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: Set up Helm
|
2024-01-18 20:03:07 +00:00
|
|
|
uses: azure/setup-helm@f382f75448129b3be48f8121b9857be18d815a82 # v3.4
|
2021-04-30 22:23:51 +00:00
|
|
|
with:
|
|
|
|
version: v3.4.2
|
|
|
|
|
|
|
|
- name: Generate chart
|
|
|
|
run: |
|
|
|
|
make helm.generate
|
2024-02-09 07:56:47 +00:00
|
|
|
## Temporarily removing - This is making the release break.
|
|
|
|
# - name: Import GPG key
|
|
|
|
# run: |
|
|
|
|
# echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --dearmor --output keyring.gpg
|
|
|
|
# echo "${{ secrets.GPG_PASSPHRASE }}" > passphrase-file.txt
|
2021-04-30 22:23:51 +00:00
|
|
|
- name: Run chart-releaser
|
2024-01-18 20:03:07 +00:00
|
|
|
uses: helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # v1.6.0
|
2023-06-22 21:22:21 +00:00
|
|
|
if: |
|
|
|
|
github.ref == 'refs/heads/main' ||
|
|
|
|
startsWith(github.ref, 'refs/heads/release-')
|
2021-04-30 22:23:51 +00:00
|
|
|
env:
|
2024-02-09 07:56:47 +00:00
|
|
|
## Temporarily removing - This is making the release break
|
|
|
|
# CR_KEY: external-secrets <external-secrets@external-secrets.io>
|
|
|
|
# CR_KEYRING: keyring.gpg
|
|
|
|
# CR_PASSPHRASE_FILE: passphrase-file.txt
|
|
|
|
# CR_SIGN: true
|
2021-04-30 22:23:51 +00:00
|
|
|
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
CR_RELEASE_NAME_TEMPLATE: "helm-chart-{{ .Version }}"
|
|
|
|
with:
|
|
|
|
charts_dir: deploy/charts
|
2023-12-23 21:30:03 +00:00
|
|
|
skip_existing: true
|
2021-04-30 22:23:51 +00:00
|
|
|
charts_repo_url: https://charts.external-secrets.io
|
2024-03-27 12:49:32 +00:00
|
|
|
|
|
|
|
- name: Set up Helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
|
|
|
with:
|
|
|
|
version: v3.14.2 # remember to also update for the first job (lint-and-test)
|
|
|
|
|
|
|
|
- name: Login to GHCR
|
2024-07-29 08:24:17 +00:00
|
|
|
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
2024-03-27 12:49:32 +00:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Push chart to GHCR
|
|
|
|
run: |
|
|
|
|
shopt -s nullglob
|
|
|
|
for pkg in .cr-release-packages/*.tgz; do
|
|
|
|
if [ -z "${pkg:-}" ]; then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts"
|
|
|
|
done
|