Workflow file for this run
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: 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)" |