From 53f37bc75a1bc50572960aaff565865ec4fc9798 Mon Sep 17 00:00:00 2001 From: Alex Lebens Date: Fri, 14 Mar 2025 14:34:07 -0500 Subject: [PATCH] update workflows --- .../workflows/release-charts-cloudflared.yml | 45 +++++++++++++++++++ .../release-charts-generic-device-plugin.yml | 45 +++++++++++++++++++ .../release-charts-postgres-cluster.yml | 45 +++++++++++++++++++ .gitea/workflows/release-to-harbor.yml | 38 ---------------- 4 files changed, 135 insertions(+), 38 deletions(-) create mode 100644 .gitea/workflows/release-charts-cloudflared.yml create mode 100644 .gitea/workflows/release-charts-generic-device-plugin.yml create mode 100644 .gitea/workflows/release-charts-postgres-cluster.yml delete mode 100644 .gitea/workflows/release-to-harbor.yml diff --git a/.gitea/workflows/release-charts-cloudflared.yml b/.gitea/workflows/release-charts-cloudflared.yml new file mode 100644 index 0000000..220fb28 --- /dev/null +++ b/.gitea/workflows/release-charts-cloudflared.yml @@ -0,0 +1,45 @@ +name: release-charts-cloudflared + +on: + push: + branches: + - main + paths: + - "charts/cloudflared" + + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Helm + uses: azure/setup-helm@v3 + with: + token: ${{ secrets.GITEA_TOKEN }} + version: latest + id: install + + - name: Package Helm Chart + run: | + cd charts/cloudflared + 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 }}/${{ vars.REGISTRY_USER }} + + - name: Publish Helm Chart to Gitea + run: | + helm registry login ${{ vars.REPOSITORY_HOST }} -u ${{ github.actor }} -p ${{ secrets.REPOSITORY_TOKEN }} + helm push ${{ env.PACKAGE_PATH }} oci://${{ vars.REPOSITORY_HOST }}/${{ github.actor }} + + - name: Release Helm Chart + uses: akkuman/gitea-release-action@v1 + with: + files: |- + ${{ env.PACKAGE_PATH }} diff --git a/.gitea/workflows/release-charts-generic-device-plugin.yml b/.gitea/workflows/release-charts-generic-device-plugin.yml new file mode 100644 index 0000000..9c19448 --- /dev/null +++ b/.gitea/workflows/release-charts-generic-device-plugin.yml @@ -0,0 +1,45 @@ +name: release-charts-generic-device-plugin + +on: + push: + branches: + - main + paths: + - "charts/generic-device-plugin" + + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Helm + uses: azure/setup-helm@v3 + with: + token: ${{ secrets.GITEA_TOKEN }} + version: latest + id: install + + - name: Package Helm Chart + run: | + cd charts/generic-device-plugin + 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 }}/${{ vars.REGISTRY_USER }} + + - name: Publish Helm Chart to Gitea + run: | + helm registry login ${{ vars.REPOSITORY_HOST }} -u ${{ github.actor }} -p ${{ secrets.REPOSITORY_TOKEN }} + helm push ${{ env.PACKAGE_PATH }} oci://${{ vars.REPOSITORY_HOST }}/${{ github.actor }} + + - name: Release Helm Chart + uses: akkuman/gitea-release-action@v1 + with: + files: |- + ${{ env.PACKAGE_PATH }} diff --git a/.gitea/workflows/release-charts-postgres-cluster.yml b/.gitea/workflows/release-charts-postgres-cluster.yml new file mode 100644 index 0000000..7ee76df --- /dev/null +++ b/.gitea/workflows/release-charts-postgres-cluster.yml @@ -0,0 +1,45 @@ +name: release-charts-postgres-cluster + +on: + push: + branches: + - main + paths: + - "charts/postgres-cluster" + + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Helm + uses: azure/setup-helm@v3 + with: + token: ${{ secrets.GITEA_TOKEN }} + version: latest + id: install + + - name: Package Helm Chart + run: | + cd charts/postgres-cluster + 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 }}/${{ vars.REGISTRY_USER }} + + - name: Publish Helm Chart to Gitea + run: | + helm registry login ${{ vars.REPOSITORY_HOST }} -u ${{ github.actor }} -p ${{ secrets.REPOSITORY_TOKEN }} + helm push ${{ env.PACKAGE_PATH }} oci://${{ vars.REPOSITORY_HOST }}/${{ github.actor }} + + - name: Release Helm Chart + uses: akkuman/gitea-release-action@v1 + with: + files: |- + ${{ env.PACKAGE_PATH }} diff --git a/.gitea/workflows/release-to-harbor.yml b/.gitea/workflows/release-to-harbor.yml deleted file mode 100644 index b758287..0000000 --- a/.gitea/workflows/release-to-harbor.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Release Charts -# https://github.com/thpham/helm-oci-charts-releaser - -on: - push: - branches: - - main - paths: - - 'charts/**' - -jobs: - release: - runs-on: ubuntu-latest - permissions: - contents: write - packages: write - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Configure Git - run: | - git config user.name "${{ gitea.actor }}" - git config user.email "${{ gitea.actor }}@users.noreply.${{ vars.REPOSITORY_HOST }}" - - - name: Run chart-releaser - uses: https://github.com/thpham/helm-oci-charts-releaser@v1 - with: - oci_registry: ${{ vars.REGISTRY_HOST }}/v2/helm-charts - oci_username: ${{ vars.REGISTRY_USER }} - oci_password: ${{ secrets.REGISTRY_SECRET }} - gitea_server: ${{ vars.REPOSITORY_HOST }} - gitea_token: ${{ secrets.REPOSITORY_TOKEN }} - tag_name_pattern: '{chartName}-chart' - skip_existing: true - version: 3.17.1