Skip to content

Commit

Permalink
[refactor] Not storing the keyring locally, configuring on GH action
Browse files Browse the repository at this point in the history
* One should import the keyring first for signing the package

Signed-off-by: dd di cesare <[email protected]>
  • Loading branch information
didierofrivia committed Jan 31, 2025
1 parent c41c302 commit 795585a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/release-helm-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ jobs:
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Configure GPG Key
run: |
echo -n "$GPG_SIGNING_KEY" | base64 -d | gpg --import
env:
GPG_SIGNING_KEY: ${{ secrets.HELM_CHARTS_SIGNING_KEY }}

- name: Package Helm Chart
run: |
GPG_KEYRING_BASE64=${{ secrets.HELM_CHARTS_SIGNING_KEY }} \
GPG_KEY_UID="Kuadrant Development Team" \
make helm-package
Expand Down
20 changes: 10 additions & 10 deletions make/helm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ helm-upgrade: $(HELM) ## Upgrade the helm chart
# Upgrade the helm chart in the cluster
$(HELM) upgrade $(CHART_NAME) $(CHART_DIRECTORY)

# GPG_KEY_UID: substring of the desired key's uid, the name or email
GPG_KEY_UID ?= 'Kuadrant Development Team'
# GPG_KEYRING_BASE64: the gpg keyring base64 encoded
GPG_KEYRING_BASE64 ?= <KUADRANT_GPG_KEYRING_BASE64>

.PHONY: helm-package
helm-package: $(HELM) ## Package the helm chart and GPG sign it
# Store the key
mkdir -p .gpg
echo $(GPG_KEYRING_BASE64) | base64 -d > .gpg/kuadrantsecring.gpg #storing base64 GPG key into keyring
helm-package: $(HELM) ## Package the helm chart
# Package the helm chart
$(HELM) package --sign --key $(GPG_KEY_UID) --keyring .gpg/kuadrantsecring.gpg $(CHART_DIRECTORY)
$(HELM) package $(CHART_DIRECTORY)

# GPG_KEY_UID: substring of the desired key's uid, the name or email
GPG_KEY_UID ?= 'Kuadrant Development Team'
# The keyring should've been imported before running this target
.PHONY: helm-package-sign
helm-package-sign: $(HELM) ## Package the helm chart and GPG sign it
# Package the helm chart and sign it
$(HELM) package --sign --key $(GPG_KEY_UID) $(CHART_DIRECTORY)

# GitHub Token with permissions to upload to the release assets
HELM_WORKFLOWS_TOKEN ?= <YOUR-TOKEN>
Expand Down

0 comments on commit 795585a

Please sign in to comment.