name: Release on: push: tags: - "**" jobs: publish-chart: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5.0.0 with: fetch-depth: 0 - name: Install packages via apt run: | apt update --yes apt install --yes curl ca-certificates curl gnupg jq - name: Install helm env: HELM_VERSION: v3.19.0 # renovate: datasource=github-releases depName=helm/helm run: | curl --fail --location --output /dev/stdout --silent --show-error https://get.helm.sh/helm-${HELM_VERSION}-linux-$(dpkg --print-architecture).tar.gz | tar --extract --gzip --file /dev/stdin mv linux-$(dpkg --print-architecture)/helm /usr/local/bin/ rm --force --recursive linux-$(dpkg --print-architecture) helm-${HELM_VERSION}-linux-$(dpkg --print-architecture).tar.gz helm version - name: Install yq env: YQ_VERSION: v4.45.4 # renovate: datasource=github-releases depName=mikefarah/yq run: | curl --fail --location --output /dev/stdout --silent --show-error https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_$(dpkg --print-architecture).tar.gz | tar --extract --gzip --file /dev/stdin mv yq_linux_$(dpkg --print-architecture) /usr/local/bin rm --force --recursive yq_linux_$(dpkg --print-architecture) yq_linux_$(dpkg --print-architecture).tar.gz yq --version - name: Add Artifacthub.io annotations run: | NEW_TAG="$(git tag --sort=-version:refname | head -n 1)" OLD_TAG="$(git tag --sort=-version:refname | head -n 2 | tail -n 1)" .gitea/scripts/add-annotations.sh "${OLD_TAG}" "${NEW_TAG}" - name: Extract meta information run: | 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: Update Helm Chart version in README.md run: sed -i -E "s/^CHART_VERSION=.*/CHART_VERSION=${PACKAGE_VERSION}/g" README.md - name: Package chart run: | helm dependency build helm package --version "${PACKAGE_VERSION}" ./ - name: Upload Chart to ChartMuseum env: 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