Testing Helm charts signing 4 #4
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 Charts | |
on: | |
push: | |
branches: [master] | |
paths: | |
- charts/** | |
workflow_dispatch: | |
jobs: | |
release: | |
permissions: | |
contents: write # to push chart release and create a release (helm/chart-releaser-action) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout HiveMQ Helm Charts | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 | |
- name: Fetch history | |
run: git fetch --prune --unshallow | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: Set up Helm | |
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4 | |
- name: Add dependency chart repos | |
run: | | |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | |
# As https://colinwilson.uk/2022/01/27/how-to-sign-helm-charts-using-chart-releaser-action/ | |
# More about generating GPG: https://blog.devops.dev/a-guide-to-signing-helm-charts-with-gpg-using-github-action-and-sign-images-on-artifacthub-958a23010e94 | |
# New 2 Secrets added to Helm Chart repo: | |
# - GPG_KEYRING_BASE64 (content of the /Users/antonio.alhambra/Projects/secring.gpg.base64) | |
# - GPG_PASSPHRASE (usual password) | |
- name: Prepare GPG keys for signing HiveMQ Helm Charts | |
run: | | |
gpg_dir=.cr-gpg | |
mkdir "$gpg_dir" | |
keyring="$gpg_dir/secring.gpg" | |
base64 -d <<< "$GPG_KEYRING_BASE64" > "$keyring" | |
passphrase_file="$gpg_dir/passphrase" | |
echo "$GPG_PASSPHRASE" > "$passphrase_file" | |
echo "CR_PASSPHRASE_FILE=$passphrase_file" >> "$GITHUB_ENV" | |
echo "CR_KEYRING=$keyring" >> "$GITHUB_ENV" | |
env: | |
GPG_KEYRING: "${{ secrets.SIGNING_KEY }}" | |
GPG_PASSPHRASE: "${{ secrets.SIGNING_PASSWORD }}" | |
- name: Run chart-releaser | |
uses: helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # v1.6.0 | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
with: | |
config: ./.github/chart-releaser.yml |