Release Chart for 0.24.2 version (#1346) #60
This file contains 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
name: Release Helm Chart and Carvel package | |
on: | |
push: | |
paths: | |
# update this file to trigger helm chart release | |
- 'helm/sealed-secrets/Chart.yaml' | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: Install Helm | |
uses: azure/[email protected] | |
with: | |
version: v3.4.2 | |
- name: Run chart-releaser | |
uses: helm/[email protected] | |
with: | |
charts_dir: helm | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
CR_RELEASE_NAME_TEMPLATE: "helm-v{{ .Version }}" | |
- name: Install Carvel | |
uses: carvel-dev/[email protected] | |
with: | |
only: kbld, imgpkg | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install yq | |
run: | | |
mkdir -p ~/bin | |
wget https://github.com/mikefarah/yq/releases/download/v4.30.8/yq_linux_amd64 -O ~/bin/yq | |
chmod +x ~/bin/yq | |
- name: Get chart version | |
run: | | |
export PATH=~/bin:$PATH | |
echo "chart_version=$(yq .version < ./helm/sealed-secrets/Chart.yaml)" >> $GITHUB_ENV | |
- name: Create imglock file | |
working-directory: ./helm | |
run: | | |
mkdir -p .imgpkg | |
kbld -f <(helm template sealed-secrets) --imgpkg-lock-output .imgpkg/images.yml | |
- name: Push imgpkg bundle | |
working-directory: ./helm | |
env: | |
IMGPKG_REGISTRY_HOSTNAME: ghcr.io | |
IMGPKG_REGISTRY_USERNAME: ${{ github.actor }} | |
IMGPKG_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
imgpkg push -b ghcr.io/${{ github.repository_owner }}/sealed-secrets-carvel:${{ env.chart_version }} -f . | |
- name: Update package.yaml | |
run: | | |
yq -i '.spec.version = "${{ env.chart_version }}"' carvel/package.yaml | |
yq -i '.metadata.name = "sealedsecrets.bitnami.com.${{ env.chart_version }}"' carvel/package.yaml | |
yq -i '.spec.template.spec.fetch.0.imgpkgBundle.image = "ghcr.io/${{ github.repository_owner }}/sealed-secrets-carvel:${{ env.chart_version }}"' carvel/package.yaml | |
# Commenting the git commit action | |
#- name: Commit package.yaml | |
#run: | | |
#git add ./carvel/package.yaml | |
#git commit -s -m 'Update package to version ${{ env.chart_version }}' | |
#git push |