Skip to content

Merge pull request #95 from emsearcy/fix/heimdall-ca-algorithm-condit… #40

Merge pull request #95 from emsearcy/fix/heimdall-ca-algorithm-condit…

Merge pull request #95 from emsearcy/fix/heimdall-ca-algorithm-condit… #40

Workflow file for this run

---
# Copyright The Linux Foundation and each contributor to LFX.
# SPDX-License-Identifier: MIT
name: Release
on:
push:
tags:
- 'v*'
env:
COSIGN_VERSION: v3.0.2
HELM_VERSION: 4.0.1
permissions:
contents: read
jobs:
release-helm-chart:
runs-on: ubuntu-24.04
permissions:
contents: write
packages: write
id-token: write
outputs:
digest: ${{ steps.publish-ghcr.outputs.digest }}
image_name: ${{ steps.publish-ghcr.outputs.image_name }}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Prepare versions and chart name
id: prepare
run: |
set -euo pipefail
CHART_NAME="$(yq '.name' charts/*/Chart.yaml)"
CHART_VERSION=$(echo ${{ github.ref_name }} | sed 's/v//g')
{
echo "chart_name=$CHART_NAME"
echo "chart_version=$CHART_VERSION"
} >> "$GITHUB_OUTPUT"
- name: Publish Chart to GHCR
id: publish-ghcr
uses: >- # main
linuxfoundation/lfx-public-workflows/.github/actions/helm-chart-oci-publisher@17e4144d7ba68f7c3e8c16eece5aed15fd7c2dc8
with:
name: ${{ steps.prepare.outputs.chart_name }}
repository: ${{ github.repository }}/chart
chart_version: ${{ steps.prepare.outputs.chart_version }}
registry: ghcr.io
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
- name: Install Cosign
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
with:
cosign-release: "${{ env.COSIGN_VERSION }}"
- name: Login to GitHub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Sign the Helm chart in GHCR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
cosign sign --yes '${{ steps.publish-ghcr.outputs.image_name }}@${{ steps.publish-ghcr.outputs.digest }}'
create-ghcr-helm-provenance:
needs:
- release-helm-chart
permissions:
actions: read
id-token: write
packages: write
# Note, this action *cannot* be pinned to a ref: see the project's
# explanation at "Referencing SLSA builders and generators" in their
# README.
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
image: ${{ needs.release-helm-chart.outputs.image_name }}
digest: ${{ needs.release-helm-chart.outputs.digest }}
registry-username: ${{ github.actor }}
secrets:
registry-password: ${{ secrets.GITHUB_TOKEN }}