Compare commits

..

3 Commits

Author SHA1 Message Date
d65c48b880 fix(ci): upload metadata for artifacthub
All checks were successful
Helm / helm-lint (push) Successful in 4s
Helm / helm-unittest (push) Successful in 8s
Generate README / generate-parameters (push) Successful in 27s
Markdown linter / markdown-link-checker (push) Successful in 13s
Markdown linter / markdown-lint (push) Successful in 29s
2026-02-07 21:49:25 +01:00
bec440645b feat: support OCI 2026-02-07 21:42:20 +01:00
873b7d9a5e fix(scripts): support pre-releases 2026-02-07 19:26:20 +01:00
8 changed files with 171 additions and 82 deletions

View File

@@ -1,61 +1,65 @@
#!/bin/bash
set -e
set -e -o pipefail
CHART_FILE="Chart.yaml"
if [ ! -f "${CHART_FILE}" ]; then
echo "ERROR: ${CHART_FILE} not found!" 1>&2
chart_file="Chart.yaml"
if [ ! -f "${chart_file}" ]; then
echo "ERROR: ${chart_file} not found!" 1>&2
exit 1
fi
DEFAULT_NEW_TAG="$(git tag --sort=-version:refname | head -n 1)"
DEFAULT_OLD_TAG="$(git tag --sort=-version:refname | head -n 2 | tail -n 1)"
default_new_tag="$(git tag --sort=-version:refname | head -n 1)"
default_old_tag="$(git tag --sort=-version:refname | head -n 2 | tail -n 1)"
if [ -z "${1}" ]; then
read -p "Enter start tag [${DEFAULT_OLD_TAG}]: " OLD_TAG
if [ -z "${OLD_TAG}" ]; then
OLD_TAG="${DEFAULT_OLD_TAG}"
echo "Enter start tag [${default_old_tag}]:"
read -r old_tag
if [ -z "${old_tag}" ]; then
old_tag="${default_old_tag}"
fi
while [ -z "$(git tag --list "${OLD_TAG}")" ]; do
echo "ERROR: Tag '${OLD_TAG}' not found!" 1>&2
read -p "Enter start tag [${DEFAULT_OLD_TAG}]: " OLD_TAG
if [ -z "${OLD_TAG}" ]; then
OLD_TAG="${DEFAULT_OLD_TAG}"
while [ -z "$(git tag --list "${old_tag}")" ]; do
echo "ERROR: Tag '${old_tag}' not found!" 1>&2
echo "Enter start tag [${default_old_tag}]:"
read -r old_tag
if [ -z "${old_tag}" ]; then
old_tag="${default_old_tag}"
fi
done
else
OLD_TAG=${1}
if [ -z "$(git tag --list "${OLD_TAG}")" ]; then
echo "ERROR: Tag '${OLD_TAG}' not found!" 1>&2
old_tag=${1}
if [ -z "$(git tag --list "${old_tag}")" ]; then
echo "ERROR: Tag '${old_tag}' not found!" 1>&2
exit 1
fi
fi
if [ -z "${2}" ]; then
read -p "Enter end tag [${DEFAULT_NEW_TAG}]: " NEW_TAG
if [ -z "${NEW_TAG}" ]; then
NEW_TAG="${DEFAULT_NEW_TAG}"
echo "Enter end tag [${default_new_tag}]:"
read -r new_tag
if [ -z "${new_tag}" ]; then
new_tag="${default_new_tag}"
fi
while [ -z "$(git tag --list "${NEW_TAG}")" ]; do
echo "ERROR: Tag '${NEW_TAG}' not found!" 1>&2
read -p "Enter end tag [${DEFAULT_NEW_TAG}]: " NEW_TAG
if [ -z "${NEW_TAG}" ]; then
NEW_TAG="${DEFAULT_NEW_TAG}"
while [ -z "$(git tag --list "${new_tag}")" ]; do
echo "ERROR: Tag '${new_tag}' not found!" 1>&2
echo "Enter end tag [${default_new_tag}]:"
read -r new_tag
if [ -z "${new_tag}" ]; then
new_tag="${default_new_tag}"
fi
done
else
NEW_TAG=${2}
new_tag=${2}
if [ -z "$(git tag --list "${NEW_TAG}")" ]; then
echo "ERROR: Tag '${NEW_TAG}' not found!" 1>&2
if [ -z "$(git tag --list "${new_tag}")" ]; then
echo "ERROR: Tag '${new_tag}' not found!" 1>&2
exit 1
fi
fi
CHANGE_LOG_YAML=$(mktemp)
echo "[]" > "${CHANGE_LOG_YAML}"
change_log_yaml=$(mktemp)
echo "[]" > "${change_log_yaml}"
function map_type_to_kind() {
case "${1}" in
@@ -80,35 +84,42 @@ function map_type_to_kind() {
esac
}
COMMIT_TITLES="$(git log --pretty=format:"%s" "${OLD_TAG}..${NEW_TAG}")"
commit_titles="$(git log --pretty=format:"%s" "${old_tag}..${new_tag}")"
echo "INFO: Generate change log entries from ${OLD_TAG} until ${NEW_TAG}"
echo "INFO: Generate change log entries from ${old_tag} until ${new_tag}"
while IFS= read -r line; do
if [[ "${line}" =~ ^([a-zA-Z]+)(\([^\)]+\))?\:\ (.+)$ ]]; then
TYPE="${BASH_REMATCH[1]}"
KIND=$(map_type_to_kind "${TYPE}")
type="${BASH_REMATCH[1]}"
kind=$(map_type_to_kind "${type}")
if [ "${KIND}" == "skip" ]; then
if [ "${kind}" == "skip" ]; then
continue
fi
DESC="${BASH_REMATCH[3]}"
desc="${BASH_REMATCH[3]}"
echo "- ${KIND}: ${DESC}"
echo "- ${kind}: ${desc}"
jq --arg kind "${KIND}" --arg description "${DESC}" '. += [ $ARGS.named ]' < "${CHANGE_LOG_YAML}" > "${CHANGE_LOG_YAML}.new"
mv "${CHANGE_LOG_YAML}.new" "${CHANGE_LOG_YAML}"
jq --arg kind "${kind}" --arg description "${desc}" '. += [ $ARGS.named ]' < "${change_log_yaml}" > "${change_log_yaml}.new"
mv "${change_log_yaml}.new" "${change_log_yaml}"
fi
done <<< "${COMMIT_TITLES}"
done <<< "${commit_titles}"
if [ -s "${CHANGE_LOG_YAML}" ]; then
yq --inplace --input-format json --output-format yml "${CHANGE_LOG_YAML}"
yq --no-colors --inplace ".annotations.\"artifacthub.io/changes\" |= loadstr(\"${CHANGE_LOG_YAML}\") | sort_keys(.)" "${CHART_FILE}"
if [ -s "${change_log_yaml}" ]; then
yq --inplace --input-format json --output-format yml "${change_log_yaml}"
yq --no-colors --inplace ".annotations.\"artifacthub.io/changes\" |= loadstr(\"${change_log_yaml}\") | sort_keys(.)" "${chart_file}"
else
echo "ERROR: Changelog file is empty: ${CHANGE_LOG_YAML}" 1>&2
echo "ERROR: Changelog file is empty: ${change_log_yaml}" 1>&2
exit 1
fi
rm "${CHANGE_LOG_YAML}"
rm "${change_log_yaml}"
regexp=".*-alpha-[0-9]+(\.[0-9]+){,2}$"
if [[ "${new_tag}" =~ $regexp ]]; then
yq --inplace '.annotations."artifacthub.io/prerelease" = "true"' "${chart_file}"
else
yq --inplace '.annotations."artifacthub.io/prerelease" = "false"' "${chart_file}"
fi

View File

@@ -0,0 +1,41 @@
name: Upload ArtifactHub Metadata
on:
schedule:
- cron: '0 3 1 * *'
workflow_dispatch:
jobs:
upload-metadata:
name: "Upload artifacthub-repo.yml to OCI registry"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- uses: docker/login-action@v3.7.0
with:
registry: ${{ github.server_url }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
- uses: oras-project/setup-oras@v1.2.4
with:
version: 1.3.0 # renovate: datasource=github-tags depName=oras-project/oras extractVersion='^v?(?<version>.*)$'
- name: Extract meta information
run: |
echo "GITEA_SERVER_HOSTNAME=$(echo "${GITHUB_SERVER_URL}" | cut -d '/' -f 3)" >> $GITHUB_ENV
echo "PACKAGE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "REPOSITORY_NAME=$(echo ${GITHUB_REPOSITORY} | cut -d '/' -f 2 | sed --regexp-extended 's/-charts?//g')" >> $GITHUB_ENV
echo "REPOSITORY_OWNER=$(echo ${GITHUB_REPOSITORY} | cut -d '/' -f 1)" >> $GITHUB_ENV
- name: Push artifacthub-repo.yml
run: |
oras push ${GITEA_SERVER_HOSTNAME}/${REPOSITORY_OWNER}/${REPOSITORY_NAME}:artifacthub.io \
--config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml \
artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml
- name: Push public cosign key to ${GITEA_SERVER_HOSTNAME}
env:
COSIGN_PUBLIC_KEY: ${{ vars.COSIGN_PUBLIC_KEY }}
run: |
echo "${COSIGN_PUBLIC_KEY}" > cosign.pub
oras push ${GITEA_SERVER_HOSTNAME}/${REPOSITORY_OWNER}/${REPOSITORY_NAME}:cosign.pub \
--artifact-type application/vnd.dev.cosign.public-key.v1 \
--annotation org.opencontainers.image.title=cosign.pub \
cosign.pub:application/vnd.dev.cosign.public-key.v1

View File

@@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v6.0.2
- uses: azure/setup-helm@v4.3.1
with:
version: v4.0.1 # renovate: datasource=github-releases depName=helm/helm
version: "v4.0.1" # renovate: datasource=github-tags depName=helm/helm
- name: Lint helm files
run: |
helm lint --values values.yaml .
@@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v6.0.2
- uses: azure/setup-helm@v4.3.1
with:
version: v4.0.1 # renovate: datasource=github-releases depName=helm/helm
version: "v4.0.1" # renovate: datasource=github-tags depName=helm/helm
- env:
HELM_UNITTEST_VERSION: v1.0.0 #renovate: datasource=github-releases depName=helm-unittest/helm-unittest
name: Install helm-unittest

View File

@@ -7,14 +7,26 @@ on:
jobs:
publish-chart:
container:
image: docker.io/volkerraschek/helm:3.19.2
runs-on: ubuntu-latest
steps:
- name: Install packages via apk
- uses: sigstore/cosign-installer@v4.0.0
with:
cosign-release: "v2.6.2" # renovate: datasource=github-tags depName=sigstore/cosign
- uses: azure/setup-helm@v4.3.1
with:
version: "v4.0.1" # renovate: datasource=github-tags depName=helm/helm
- name: Install helm plugins
env:
HELM_SIGSTORE_VERSION: "0.3.0" # renovate: datasource=github-tags depName=sigstore/helm-sigstore extractVersion='^v(?<version>\d+\.\d+\.\d+)$'
HELM_SCHEMA_VALUES_VERSION: "2.3.1" # renovate: datasource=github-tags depName=losisin/helm-values-schema-json extractVersion='^v(?<version>\d+\.\d+\.\d+)$'
HELM_UNITTEST_VERSION: "1.0.3" # renovate: datasource=github-tags depName=helm-unittest/helm-unittest extractVersion='^v(?<version>\d+\.\d+\.\d+)$'
run: |
apk update
apk add git npm jq yq
helm plugin install --verify=false https://github.com/sigstore/helm-sigstore.git --version "${HELM_SIGSTORE_VERSION}" 1> /dev/null
helm plugin install --verify=false https://github.com/losisin/helm-values-schema-json.git --version "${HELM_SCHEMA_VALUES_VERSION}" 1> /dev/null
helm plugin install --verify=false https://github.com/helm-unittest/helm-unittest.git --version "${HELM_UNITTEST_VERSION}" 1> /dev/null
helm plugin list
- uses: actions/checkout@v6.0.2
with:
@@ -28,6 +40,7 @@ jobs:
- name: Extract meta information
run: |
echo "GITEA_SERVER_HOSTNAME=$(echo "${GITHUB_SERVER_URL}" | cut -d '/' -f 3)" >> $GITHUB_ENV
echo "PACKAGE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "REPOSITORY_NAME=$(echo ${GITHUB_REPOSITORY} | cut -d '/' -f 2 | sed --regexp-extended 's/-charts?//g')" >> $GITHUB_ENV
echo "REPOSITORY_OWNER=$(echo ${GITHUB_REPOSITORY} | cut -d '/' -f 1)" >> $GITHUB_ENV
@@ -40,22 +53,43 @@ jobs:
helm dependency build
helm package --version "${PACKAGE_VERSION}" ./
- name: Upload Chart to ChartMuseum
- uses: docker/login-action@v3.7.0
with:
registry: ${{ github.server_url }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
- name: Upload Chart to Gitea (OCI)
env:
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
run: |
helm push ${REPOSITORY_NAME}-${PACKAGE_VERSION}.tgz oci://${GITEA_SERVER_HOSTNAME}/${REPOSITORY_OWNER}
cosign sign --yes --upload=true --key=env://COSIGN_PRIVATE_KEY ${GITEA_SERVER_HOSTNAME}/${REPOSITORY_OWNER}/${REPOSITORY_NAME}:${PACKAGE_VERSION}
- name: Upload Chart to Gitea (Helm)
env:
GITEA_REGISTRY_TOKEN: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
run: |
curl \
--fail \
--show-error \
--request POST \
--user "${REPOSITORY_OWNER}:${GITEA_REGISTRY_TOKEN}" \
--upload-file "${REPOSITORY_NAME}-${PACKAGE_VERSION}.tgz" \
https://git.cryptic.systems/api/packages/${REPOSITORY_OWNER}/helm/api/charts
- name: Upload Chart to Chartmuseum (Helm)
env:
CHARTMUSEUM_HOSTNAME: ${{ vars.CHARTMUSEUM_HOSTNAME }}
CHARTMUSEUM_USERNAME: ${{ secrets.CHARTMUSEUM_USERNAME }}
CHARTMUSEUM_PASSWORD: ${{ secrets.CHARTMUSEUM_PASSWORD }}
CHARTMUSEUM_REPOSITORY: ${{ vars.CHARTMUSEUM_REPOSITORY }}
CHARTMUSEUM_USERNAME: ${{ secrets.CHARTMUSEUM_USERNAME }}
CHARTMUSEUM_HOSTNAME: ${{ vars.CHARTMUSEUM_HOSTNAME }}
run: |
helm repo add --username ${CHARTMUSEUM_USERNAME} --password ${CHARTMUSEUM_PASSWORD} chartmuseum https://${CHARTMUSEUM_HOSTNAME}/${CHARTMUSEUM_REPOSITORY}
helm cm-push ${REPOSITORY_NAME}-${PACKAGE_VERSION}.tgz chartmuseum
helm repo remove chartmuseum
- name: Upload Chart to Gitea
env:
GITEA_PACKAGE_REGISTRY_TOKEN: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
GITEA_SERVER_URL: ${{ github.server_url }}
run: |
helm repo add --username ${REPOSITORY_OWNER} --password ${GITEA_PACKAGE_REGISTRY_TOKEN} gitea ${GITEA_SERVER_URL}/api/packages/${REPOSITORY_OWNER}/helm
helm cm-push ${REPOSITORY_NAME}-${PACKAGE_VERSION}.tgz gitea
helm repo remove gitea
curl \
--fail \
--show-error \
--request POST \
--user "${CHARTMUSEUM_USERNAME}:${CHARTMUSEUM_PASSWORD}" \
--upload-file "${REPOSITORY_NAME}-${PACKAGE_VERSION}.tgz" \
https://${CHARTMUSEUM_HOSTNAME}/api/${CHARTMUSEUM_REPOSITORY}/charts

1
.gitignore vendored
View File

@@ -1,4 +1,5 @@
charts
cosign*
node_modules
target
values2.yml

View File

@@ -1,24 +1,25 @@
annotations:
artifacthub.io/license: MIT
artifacthub.io/links: |
- name: Prometheus PostgreSQL exporter (binary)
url: https://github.com/prometheus-community/postgres_exporter
- name: support
url: https://git.cryptic.systems/volker.raschek/prometheus-postgres-exporter/issues
artifacthub.io/operator: "false"
artifacthub.io/prerelease: "false"
apiVersion: v2
name: prometheus-postgres-exporter
appVersion: "0.18.1"
description: Prometheus metric exporter for PostgreSQL
home: https://git.cryptic.systems/volker.raschek/prometheus-postgres-exporter
# icon: https://annotations.example.com/icon.png
keywords:
- prometheus
- prometheus-exporter
- postgres-postgres-exporter
- postgres-exporter
name: prometheus-postgres-exporter
sources:
- https://github.com/prometheus-community/postgres_exporter
- https://git.cryptic.systems/volker.raschek/prometheus-postgres-exporter
type: application
version: "0.1.0"
appVersion: "0.18.1"
# icon: https://annotations.example.com/icon.png
keywords:
- prometheus
- prometheus-exporter
- postgres-postgres-exporter
- postgres-exporter
sources:
- https://github.com/prometheus-community/postgres_exporter
- https://git.cryptic.systems/volker.raschek/prometheus-postgres-exporter

View File

@@ -34,7 +34,7 @@ separate [chapter](#argocd).
> time is not possible.
```bash
helm repo add prometheus-exporters https://charts.cryptic.systems/prometheus-exporters
helm repo add prometheus-postgres-exporters https://git.cryptic.systems/prometheus-exporters
helm repo update
CHART_VERSION=0.5.5
helm install --version "${CHART_VERSION}" prometheus-postgres-exporter prometheus-exporters/prometheus-postgres-exporter \

1
artifacthub-repo.yml Normal file
View File

@@ -0,0 +1 @@
repositoryID: d4d5f778-e029-4401-81a3-29a0f689ee08