Skip to content

Workflow file for this run

name: Publish artifacts (CRD yaml) on Release
on:
release:
types: [published]
defaults:
run:
shell: bash
jobs:
generate_crd:
name: Generate CRD
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate and Upload CRD
run: |
echo "Generating CRD"
yq '.' crds/*.yaml > crd.yaml
echo "Uploading CRD"
file=crd.yaml
upload_url="${{ github.event.release.upload_url }}"
upload_url=${upload_url%%\{*\}}
echo "Uploading $file to $upload_url ..."
curl -sSf \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ github.token }}" \
-H "Content-Type: $(file -b --mime-type $file)" \
--data-binary @$file \
"$upload_url?name=$(basename $file)"