From 6d56845184485b2ba6e5abc698c563cee1e2b8e1 Mon Sep 17 00:00:00 2001 From: amitz Date: Wed, 31 Jul 2024 16:22:25 +0300 Subject: [PATCH] release --- .github/workflows/helm.yml | 33 ------------------------ .github/workflows/release.yml | 48 +++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/helm.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml deleted file mode 100644 index f72381b..0000000 --- a/.github/workflows/helm.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Release Charts - -on: - push: - branches: - - main - -jobs: - release: - permissions: - contents: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure Git - run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - - name: Install Helm - uses: azure/setup-helm@v4 - - - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.6.0 - with: - skip_existing: true - packages_with_index: true - env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..90a4755 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: Release Charts + +on: + push: + branches: + - main + +jobs: + release: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Install Helm + uses: azure/setup-helm@v4 + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.6.0 + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + CR_GENERATE_RELEASE_NOTES: true + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push charts to GHCR + run: | + shopt -s nullglob + for pkg in .cr-release-packages/*; do + if [ -z "${pkg:-}" ]; then + break + fi + helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts" + done \ No newline at end of file