This repository has been archived by the owner on Feb 2, 2024. It is now read-only.
Merge pull request #95 from janus-idp/renovate/actions-checkout-digest #20
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: | |
- main | |
paths: | |
- "charts/**" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: Add dependencies | |
run: | | |
helm repo add bitnami https://charts.bitnami.com/bitnami | |
helm repo add backstage https://backstage.github.io/charts | |
- name: Run chart-releaser | |
uses: helm/chart-releaser-action@be16258da8010256c6e82849661221415f031968 # renovate: tag=v1.5.0 | |
with: | |
config: cr.yaml | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Cosign | |
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 # v3.1.1 | |
- name: Install Oras | |
uses: oras-project/setup-oras@c90396b2ddabd5a364e6551a79984c86cc036996 # v1.0.0 | |
- name: Publish and Sign OCI Charts | |
run: | | |
for chart in `find .cr-release-packages -name '*.tgz' -print`; do | |
helm push ${chart} oci://ghcr.io/${GITHUB_REPOSITORY} |& tee helm-push-output.log | |
file_name=${chart##*/} | |
chart_name=${file_name%-*} | |
digest=$(awk -F "[, ]+" '/Digest/{print $NF}' < helm-push-output.log) | |
cosign sign -y "ghcr.io/${GITHUB_REPOSITORY}/${chart_name}@${digest}" | |
oras push "ghcr.io/${GITHUB_REPOSITORY}/${chart_name}:artifacthub.io" "./charts/${chart_name}/artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml" | |
done | |
env: | |
COSIGN_EXPERIMENTAL: 1 |