LPD-65509 Release charts. Use minor version as we should have all alo… #28
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | defaults: | |
| run: | |
| shell: bash | |
| env: | |
| CHART_VERSION: 0.0.0 | |
| GAR_REPOSITORY: us-central1-docker.pkg.dev/liferay-artifact-registry/liferay-helm-chart | |
| jobs: | |
| publish-cloud-helm-chart: | |
| if: (github.repository == 'liferay/liferay-portal') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| name: Verify Helm chart version | |
| run: | | |
| CHART_VERSION=$(cat ./Chart.yaml | yq .version) | |
| echo "Verifying Helm chart version ${CHART_VERSION}." | |
| if helm show readme "oci://${GAR_REPOSITORY}/liferay-default:${CHART_VERSION}" >/dev/null 2>&1 | |
| then | |
| echo "Skipping Helm Chart version ${CHART_VERSION}." | |
| gh run cancel ${{ github.run_id }} | |
| gh run watch ${{ github.run_id }} >/dev/null | |
| exit 1 | |
| else | |
| echo "Verified Helm Chart version ${CHART_VERSION}." | |
| fi | |
| echo "CHART_VERSION=${CHART_VERSION}" >> ${GITHUB_ENV} | |
| working-directory: ./cloud/helm/default | |
| - name: Log in to GAR | |
| run: echo "${{ secrets.GAR_PASSWORD }}" | helm registry login ${GAR_REPOSITORY} --password-stdin --username _json_key_base64 | |
| - name: Package and Push Helm charts | |
| run: | | |
| mkdir "${{ runner.temp }}/dist" | |
| helm package --destination "${{ runner.temp }}/dist" --version ${CHART_VERSION} default | |
| sed -i "s/0\.0\.0/${CHART_VERSION}/g" aws/Chart.yaml | |
| helm dependency update aws | |
| helm package --destination "${{ runner.temp }}/dist" --version ${CHART_VERSION} aws | |
| for file_name in ${{ runner.temp }}/dist/*.tgz | |
| do | |
| echo "Pushing ${file_name}." | |
| helm push "${file_name}" "oci://${GAR_REPOSITORY}" | |
| done | |
| working-directory: ./cloud/helm | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - cloud/helm/** |