From fa6067e68bc64b74b4a4cc729a496191c4be6631 Mon Sep 17 00:00:00 2001 From: Alex Lebens Date: Sat, 24 May 2025 11:37:32 -0500 Subject: [PATCH] add workflow --- .../workflows/release-charts-barman-cloud.yml | 66 +++++++++++++++++++ charts/barman-cloud/Chart.yaml | 2 +- charts/barman-cloud/README.md | 2 +- 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 .gitea/workflows/release-charts-barman-cloud.yml diff --git a/.gitea/workflows/release-charts-barman-cloud.yml b/.gitea/workflows/release-charts-barman-cloud.yml new file mode 100644 index 0000000..a165366 --- /dev/null +++ b/.gitea/workflows/release-charts-barman-cloud.yml @@ -0,0 +1,66 @@ +name: release-charts-cloudfbarman-cloudlared + +on: + push: + branches: + - main + paths: + - "charts/barman-cloud/**" + + workflow_dispatch: + +env: + WORKFLOW_DIR: "charts/barman-cloud" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Helm + uses: azure/setup-helm@v4 + with: + token: ${{ secrets.GITEA_TOKEN }} + version: latest + + - name: Package Helm Chart + run: | + cd $WORKFLOW_DIR + helm dependency build + echo "PACKAGE_PATH=$(helm package . | awk '{print $NF}')" >> $GITEA_ENV + + - name: Publish Helm Chart to Harbor + run: | + helm registry login ${{ vars.REGISTRY_HOST }} -u ${{ vars.REGISTRY_USER }} -p ${{ secrets.REGISTRY_SECRET }} + helm push ${{ env.PACKAGE_PATH }} oci://${{ vars.REGISTRY_HOST }}/helm-charts + + - name: Publish Helm Chart to Gitea + run: | + helm plugin install https://github.com/chartmuseum/helm-push + helm repo add --username ${{ gitea.actor }} --password ${{ secrets.REPOSITORY_TOKEN }} helm-charts https://${{ vars.REPOSITORY_HOST }}/api/packages/alexlebens/helm + helm cm-push ${{ env.PACKAGE_PATH }} helm-charts + + - name: Extract Chart Metadata + run: | + cd $WORKFLOW_DIR + echo "CHART_VERSION=$(yq '.version' Chart.yaml)" >> $GITEA_ENV + echo "CHART_NAME=$(yq '.name' Chart.yaml)" >> $GITEA_ENV + + - name: Release Helm Chart + uses: akkuman/gitea-release-action@v1 + with: + name: ${{ env.CHART_NAME }}-${{ env.CHART_VERSION }} + tag_name: ${{ env.CHART_NAME }}-${{ env.CHART_VERSION }} + files: |- + ${{ env.PACKAGE_PATH }} + + - name: Actions Ntfy + run: | + curl \ + -H "Authorization: Bearer ${{ secrets.NTFY_CRED }}" \ + -H "Title: Chart Released: ${{ env.CHART_NAME }}-${{ env.CHART_VERSION }}" \ + -H "Content-Type: text/plain" \ + -d $'Repo: ${{ gitea.repository }}\nCommit: ${{ gitea.sha }}\nRef: ${{ gitea.ref }}\nStatus: ${{ job.status}}' \ + ${{ secrets.NTFY_URL }} diff --git a/charts/barman-cloud/Chart.yaml b/charts/barman-cloud/Chart.yaml index 6272d9f..2c7e785 100644 --- a/charts/barman-cloud/Chart.yaml +++ b/charts/barman-cloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: barman-cloud -version: 1.15.0 +version: 0.1.0 description: Barman Cloud Plugin keywords: - barman-cloud diff --git a/charts/barman-cloud/README.md b/charts/barman-cloud/README.md index 0f27d12..fb4daf6 100644 --- a/charts/barman-cloud/README.md +++ b/charts/barman-cloud/README.md @@ -1,6 +1,6 @@ # barman-cloud -![Version: 1.15.0](https://img.shields.io/badge/Version-1.15.0-informational?style=flat-square) ![AppVersion: v.0.4.0](https://img.shields.io/badge/AppVersion-v.0.4.0-informational?style=flat-square) +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![AppVersion: v.0.4.0](https://img.shields.io/badge/AppVersion-v.0.4.0-informational?style=flat-square) Barman Cloud Plugin