@@ -19,31 +19,45 @@ jobs:
1919 git config user.name "$GITHUB_ACTOR"
2020 git config user.email "[email protected] " 2121
22- - name : Prepare GPG Key
22+ - name : Install Helm
23+ uses : azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
24+ with :
25+ version : v3.8.1
26+
27+ - name : Prepare GPG key # This step is for using exported keys and make your github runner
2328 run : |
24- echo "# Import the GPG Key"
25- echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import
29+ # Create a folder to store files
30+ gpg_dir=.cr-gpg
31+ mkdir "$gpg_dir"
32+
33+ # Refer keyring to private key of gpg
34+ keyring="$gpg_dir/secring.gpg"
35+
36+ # Store base64 GPG key into keyring
37+ base64 -d <<< "$GPG_KEYRING_BASE64" > "$keyring"
38+
39+ # Store passphrase data into a file
40+ passphrase_file="$gpg_dir/passphrase"
41+ echo "$GPG_PASSPHRASE" > "$passphrase_file"
2642
27- echo "Create passphrase file"
28- echo "${{ secrets.GPG_PASSPHRASE }} " > passphrase.txt
43+ # Save passphrase into github-environment
44+ echo "CR_PASSPHRASE_FILE=$passphrase_file " >> "$GITHUB_ENV"
2945
30- echo "Store the GPG key ID to a file"
31- GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | grep 'sec' | cut -d: -f5)
32- echo "$GPG_KEY_ID" > gpg_key_id.txt
46+ # Save private key into github-environemnt
47+ echo "CR_KEYRING=$keyring" >> "$GITHUB_ENV"
3348 env :
34- GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
35- GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
49+ GPG_KEYRING_BASE64 : " ${{ secrets.GPG_KEYRING_BASE64 }}" # Refer secrets of github above
50+ GPG_PASSPHRASE : " ${{ secrets.GPG_PASSPHRASE }}"
3651
37- - name : Create .cr.yaml
52+ - name : Add repositories
3853 run : |
39- cat <<EOF > .cr.yaml
40- sign: true
41- # Read the key from the file.
42- key: "$(cat gpg_key_id.txt)"
43- passphrase-file: "passphrase.txt"
44- EOF
45-
46- - name : Run chart-releaser
47- 54+ for dir in $(ls -d charts/*/); do
55+ helm dependency list $dir 2> /dev/null | tail +2 | head -n -1 | awk '{ print "helm repo add " $1 " " $3 }' | while read cmd; do $cmd; done
56+ done
57+
58+ - name : Run chart-releaser # this is used to generate new version of helm chart along with some file with extension .prov
59+ uses : helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # v1.6.0
4860 env :
4961 CR_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
62+ CR_KEY : " ${{ secrets.CR_KEY }}" # Key name used while creating key
63+ CR_SIGN : true # Set to true to sign images
0 commit comments