github.com/oam-dev/kubevela@v1.9.11/.github/workflows/chart.yml (about) 1 name: Publish Chart 2 3 on: 4 push: 5 tags: 6 - "v*" 7 workflow_dispatch: { } 8 9 permissions: 10 contents: read 11 12 jobs: 13 publish-charts: 14 env: 15 HELM_CHARTS_DIR: charts 16 HELM_CHART: charts/vela-core 17 HELM_CHART_NAME: vela-core 18 runs-on: ubuntu-22.04 19 steps: 20 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 21 - name: Get git revision 22 id: vars 23 shell: bash 24 run: | 25 echo "git_revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT 26 - name: Install Helm 27 uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 28 with: 29 version: v3.4.0 30 - name: Setup node 31 uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 32 with: 33 node-version: '14' 34 - name: Generate helm doc 35 run: | 36 make helm-doc-gen 37 - name: Get the version 38 id: get_version 39 run: | 40 VERSION=${GITHUB_REF#refs/tags/} 41 echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT 42 - name: Tag helm chart image 43 run: | 44 image_tag=${{ steps.get_version.outputs.VERSION }} 45 chart_version=${{ steps.get_version.outputs.VERSION }} 46 sed -i "s/latest/${image_tag}/g" $HELM_CHART/values.yaml 47 chart_smever=${chart_version#"v"} 48 sed -i "s/0.1.0/$chart_smever/g" $HELM_CHART/Chart.yaml 49 50 - uses: jnwng/github-app-installation-token-action@v2 51 id: get_app_token 52 with: 53 appId: 340472 54 installationId: 38064967 55 privateKey: ${{ secrets.GH_KUBEVELA_APP_PRIVATE_KEY }} 56 - name: Sync Chart Repo 57 run: | 58 git config --global user.email "135009839+kubevela[bot]@users.noreply.github.com" 59 git config --global user.name "kubevela[bot]" 60 git clone https://x-access-token:${{ steps.get_app_token.outputs.token }}@github.com/kubevela/charts.git kubevela-charts 61 helm package $HELM_CHART --destination ./kubevela-charts/docs/ 62 helm repo index --url https://kubevela.github.io/charts ./kubevela-charts/docs/ 63 cd kubevela-charts/ 64 git add docs/ 65 chart_version=${{ steps.get_version.outputs.VERSION }} 66 git commit -m "update vela-core chart ${chart_version}" 67 git push https://x-access-token:${{ steps.get_app_token.outputs.token }}@github.com/kubevela/charts.git