From 906e0a5054153e35b4cb14a3ba9e169caf4c2985 Mon Sep 17 00:00:00 2001 From: Muhammad Naufal Ammar <36336568+ammarun11@users.noreply.github.com> Date: Mon, 26 May 2025 17:10:33 +0800 Subject: [PATCH 1/3] feat(): add ci github action --- .github/workflows/release.yml | 79 +++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..050533f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,79 @@ +name: Release Charts + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + release: + 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 + with: + version: v3.14.0 + + - name: Add dependency chart repos + run: | + helm repo add bitnami https://charts.bitnami.com/bitnami + helm repo update + + - name: Build chart dependencies + run: | + helm dependency build + + - name: Create public directory + run: mkdir -p public + + - name: Package Helm chart + run: | + helm package . --destination public/ + + - name: Generate index.yaml + run: | + helm repo index public/ --url https://ammarun11.github.io/helm-chart-sequin + + - name: List files + run: | + echo "Files in public directory:" + ls -la public/ + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: public/ + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: release + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file From a271442647bc0d4b9196a4501cc3990e3eb6c8aa Mon Sep 17 00:00:00 2001 From: Muhammad Naufal Ammar <36336568+ammarun11@users.noreply.github.com> Date: Mon, 26 May 2025 18:38:13 +0800 Subject: [PATCH 2/3] fix(ci): make GitHub Actions workflow dynamic for any repository --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 050533f..0cd6458 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,9 +52,9 @@ jobs: - name: Generate index.yaml run: | - helm repo index public/ --url https://ammarun11.github.io/helm-chart-sequin + helm repo index public/ --url https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }} - - name: List files + - name: List files for debugging run: | echo "Files in public directory:" ls -la public/ From c301cbf35ebbca4f61a0a26c319abf7c6535093f Mon Sep 17 00:00:00 2001 From: Muhammad Naufal Ammar <36336568+ammarun11@users.noreply.github.com> Date: Mon, 2 Jun 2025 16:26:53 +0700 Subject: [PATCH 3/3] feat: add oci package release --- .github/workflows/release.yml | 29 ++++++++++++++++++++++++++++- cr.yaml | 4 ++++ ct.yaml | 9 +++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 cr.yaml create mode 100644 ct.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0cd6458..86be3ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,9 +7,10 @@ on: workflow_dispatch: permissions: - contents: read + contents: write pages: write id-token: write + packages: write concurrency: group: "pages" @@ -43,6 +44,32 @@ jobs: run: | helm dependency build + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.5.0 + with: + charts_dir: charts + config: cr.yaml + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + CR_SKIP_EXISTING: "true" + + - name: Login to GHCR + uses: docker/login-action@v3.0.0 + 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/*.tgz; do + if [ -z "${pkg:-}" ]; then + break + fi + helm push "${pkg}" "oci://ghcr.io/${{ github.repository_owner }}/helm-charts" + done + - name: Create public directory run: mkdir -p public diff --git a/cr.yaml b/cr.yaml new file mode 100644 index 0000000..2a76bf5 --- /dev/null +++ b/cr.yaml @@ -0,0 +1,4 @@ +sign: false +# Enable automatic generation of release notes using GitHubs release notes generator. +# see: https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes +generate-release-notes: true \ No newline at end of file diff --git a/ct.yaml b/ct.yaml new file mode 100644 index 0000000..d9316f7 --- /dev/null +++ b/ct.yaml @@ -0,0 +1,9 @@ +# See https://github.com/helm/chart-testing#configuration +remote: origin +target-branch: main +chart-dirs: + - . +chart-repos: + - bitnami=https://charts.bitnami.com/bitnami +helm-extra-args: --timeout 600s +validate-maintainers: false \ No newline at end of file