Skip to content

fix chart publishing (#2916) #2268

fix chart publishing (#2916)

fix chart publishing (#2916) #2268

Workflow file for this run

name: Publish Chart
on:
push:
branches:
- master
jobs:
publish:
name: Publish helm chart
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- uses: azure/setup-helm@v3
- name: Add repos
run: |
helm repo add vmware https://vmware-tanzu.github.io/helm-charts
helm repo add radar https://radar-base.github.io/radar-helm-charts
helm repo add fluxcd-community https://fluxcd-community.github.io/helm-charts
helm repo add dashboard https://kubernetes.github.io/dashboard
helm repo add dexidp https://charts.dexidp.io
- name: Run chart-releaser
id: release
uses: helm/[email protected]
with:
config: "./.github/configs/cr.yaml"
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: console version
id: console_vsn
uses: mikefarah/yq@master
with:
cmd: yq ".version" charts/console/Chart.yaml
- uses: google-github-actions/auth@v1
with:
workload_identity_provider: "projects/${{ secrets.GOOGLE_PROJECT_ID }}/locations/global/workloadIdentityPools/github/providers/github"
service_account: "[email protected]"
token_format: "access_token"
create_credentials_file: true
- uses: google-github-actions/[email protected]
- name: Login to gcr
run: gcloud auth configure-docker -q
- name: Helm Login
id: helm_login
run: |
gcloud auth application-default print-access-token | helm registry login -u oauth2accesstoken --password-stdin https://gcr.io
echo "token=$(gcloud auth application-default print-access-token)" >> $GITHUB_OUTPUT
- name: Chart | Check
id: chart_exists
run: |
if helm pull oci://gcr.io/pluralsh/helm-charts/console --version ${{ steps.console_vsn.outputs.result }} --destination /tmp 2>/dev/null; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "Chart version ${{ steps.console_vsn.outputs.result }} already exists"
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "Chart version ${{ steps.console_vsn.outputs.result }} does not exist"
fi
continue-on-error: true
- name: Chart | OCI Push
uses: appany/[email protected]
if: ${{ steps.chart_exists.outputs.exists == 'false' }}
with:
name: console
repository: pluralsh/helm-charts
tag: ${{ steps.console_vsn.outputs.result }}
registry: gcr.io
registry_username: oauth2accesstoken
registry_password: ${{ steps.helm_login.outputs.token }}
update_dependencies: 'true' # Defaults to false