Skip to content

Open-source personal finance manager. Self-hosted, privacy-first.

Feat/helmchart pipeline artifacthub (#458)

jorishaenseler1596d68e7aa188
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 81a3cc55..c5a8c26a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -121,3 +121,51 @@ jobs:
- name: Run tests
run: npm test
+
+ helm-checks:
+ name: Helm Checks
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 2
+
+ - name: Detect helm-relevant changes
+ id: helm-changes
+ run: |
+ set -euo pipefail
+
+ if [ "${{ github.event_name }}" != "pull_request" ]; then
+ echo "run_helm=true" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+
+ changed_files="$(git diff --name-only HEAD^1 HEAD)"
+
+ if echo "$changed_files" | grep -Eq '^(charts/securo/.*|\.github/workflows/ci\.yml)$'; then
+ echo "run_helm=true" >> "$GITHUB_OUTPUT"
+ else
+ echo "run_helm=false" >> "$GITHUB_OUTPUT"
+ fi
+
+ - name: Skip helm checks
+ if: steps.helm-changes.outputs.run_helm != 'true'
+ run: echo "No helm-relevant changes; skipping helm lint."
+
+ - name: Set up Helm
+ if: steps.helm-changes.outputs.run_helm == 'true'
+ uses: azure/setup-helm@v5
+ with:
+ version: v4.2.3
+
+ - name: Lint Helm Chart
+ if: steps.helm-changes.outputs.run_helm == 'true'
+ run: helm lint charts/securo
+
+ - name: Validate Helm Chart with Kubeconform
+ if: steps.helm-changes.outputs.run_helm == 'true'
+ run: |
+ curl -sL https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz | tar -xz
+ sudo mv kubeconform /usr/local/bin/
+
+ helm template securo-test charts/securo | kubeconform -summary -strict
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 6114d727..1bc8db38 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -6,7 +6,7 @@ on:
env:
REGISTRY: ghcr.io
- IMAGE_PREFIX: ghcr.io/securo-finance
+ IMAGE_PREFIX: ghcr.io/${{ github.repository_owner }}
permissions:
contents: read
@@ -94,3 +94,52 @@ jobs:
VITE_APP_VERSION=${{ github.event.release.tag_name }}
cache-from: type=gha
cache-to: type=gha,mode=max
+
+ build-helm:
+ needs: [build-backend, build-frontend]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v7
+
+ - name: Set up Helm
+ uses: azure/setup-helm@v5
+ with:
+ version: v4.2.3
+
+ - name: Log in to GitHub Container Registry
+ uses: docker/login-action@v4
+ with:
+ registry: ${{ env.REGISTRY }}
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Package and Push Helm Chart
+ run: |
+ # Strip the 'v' prefix from the release tag if it exists, as helm chart version needs to be semver without v.
+ VERSION="${{ github.event.release.tag_name }}"
+ VERSION="${VERSION#v}"
+
+ echo "Injecting version $VERSION into artifacthub.io/images annotation"
+ sed -i "s|ghcr.io/securo-finance/securo-backend:latest|ghcr.io/securo-finance/securo-backend:${VERSION}|g" charts/securo/Chart.yaml
+ sed -i "s|ghcr.io/securo-finance/securo-frontend:latest|ghcr.io/securo-finance/securo-frontend:${VERSION}|g" charts/securo/Chart.yaml
+
+ echo "Injecting version $VERSION into values.yaml"
+ sed -i "s|tag: latest|tag: ${VERSION}|g" charts/securo/values.yaml
+
+ echo "Packaging chart version $VERSION"
+ helm package charts/securo --version "$VERSION" --app-version "$VERSION"
+
+ helm push securo-$VERSION.tgz oci://${{ env.REGISTRY }}/${{ github.repository_owner }}/charts
+
+ - name: Set up ORAS
+ uses: oras-project/setup-oras@v1
+
+ - name: Push Artifact Hub Metadata
+ run: |
+ # Artifact Hub reads this from the chart's own path, not the parent
+ # namespace: `helm push ... /charts` publishes to /charts/securo, so
+ # the metadata has to carry the same prefix or it is never found.
+ oras push ${{ env.REGISTRY }}/${{ github.repository_owner }}/charts/securo:artifacthub.io \
+ --config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml \
+ charts/securo/artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml
diff --git a/charts/securo/Chart.yaml b/charts/securo/Chart.yaml
index 87d92071..cd3c811c 100644
--- a/charts/securo/Chart.yaml
+++ b/charts/securo/Chart.yaml
@@ -5,3 +5,21 @@ type: application
version: 0.1.0
appVersion: "latest"
icon: https://raw.githubusercontent.com/securo-finance/securo/main/frontend/public/favicon.ico
+home: https://github.com/securo-finance/securo
+sources:
+ - https://github.com/securo-finance/securo
+keywords:
+ - finance
+ - accounting
+ - securo
+annotations:
+ artifacthub.io/license: "AGPL-3.0"
+ artifacthub.io/category: "finance"
+ artifacthub.io/images: |
+ - name: securo-backend
+ image: ghcr.io/securo-finance/securo-backend:latest
+ - name: securo-frontend
+ image: ghcr.io/securo-finance/securo-frontend:latest
+ artifacthub.io/links: |
+ - name: Source
+ url: https://github.com/securo-finance/securo
diff --git a/charts/securo/README.md b/charts/securo/README.md
index 565e79cd..dd4bbacb 100644
--- a/charts/securo/README.md
+++ b/charts/securo/README.md
@@ -24,7 +24,13 @@ If your storage only supports `ReadWriteOnce` (RWO), you must restrict all Secur
## Quickstart
-If you are installing locally from the source repository:
+If you want to install the latest official release from the GitHub Container Registry (GHCR):
+
+```bash
+helm install securo oci://ghcr.io/securo-finance/charts/securo --version <VERSION>
+```
+
+If you are developing locally and want to install from the source repository:
```bash
helm install securo ./charts/securo
diff --git a/charts/securo/artifacthub-repo.yml b/charts/securo/artifacthub-repo.yml
new file mode 100644
index 00000000..90173093
--- /dev/null
+++ b/charts/securo/artifacthub-repo.yml
@@ -0,0 +1,4 @@
+# Artifact Hub repository metadata file.
+# Pushed to the chart's own OCI path on release, which is where Artifact Hub
+# looks for it to confirm we control the repository and grant Verified Publisher.
+repositoryID: aa1216ae-b8b8-4352-908f-21a55d9829a0