diff --git a/.github/workflows/helm-chart-release.yaml b/.github/workflows/helm-chart-release.yaml index e3a3e32bc..b611dde89 100644 --- a/.github/workflows/helm-chart-release.yaml +++ b/.github/workflows/helm-chart-release.yaml @@ -1,33 +1,26 @@ -name: Release Charts +name: Release Helm Charts on: [workflow_dispatch] jobs: release: - # depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions - # see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token - permissions: - contents: write runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 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@v3 with: version: v3.10.0 - - - name: Run chart-releaser + - name: Build helm package + run: cd helm-charts && helm package ./infisical uses: helm/chart-releaser-action@v1.4.1 - with: - charts_dir: helm-charts + - name: Install python and Cloudsmith CLI + uses: actions/setup-python@v4 + run: pip install --upgrade cloudsmith-cli + - name: Push helm package to Cloudsmith + run: cd helm-charts && sh upload-to-cloudsmith.sh env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} \ No newline at end of file diff --git a/helm-charts/upload-to-cloudsmith.sh b/helm-charts/upload-to-cloudsmith.sh new file mode 100644 index 000000000..218c11149 --- /dev/null +++ b/helm-charts/upload-to-cloudsmith.sh @@ -0,0 +1,10 @@ +## Loop through each helm chart directoy and build each into helm package +for d in */ ; do + helm package $d +done + +## Upload each packaged helm chart +for i in *.tgz; do + [ -f "$i" ] || break + cloudsmith push helm --republish infisical/helm-charts $i +done \ No newline at end of file