Skip to content

Commit

Permalink
chore: add CRDs file to release assets
Browse files Browse the repository at this point in the history
Signed-off-by: Rory Z <16801068+Rory-Z@users.noreply.github.com>
  • Loading branch information
Rory-Z committed Jan 13, 2025
1 parent 94c9b27 commit 4e91eb5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
echo "Need update appVersion for Chart.yaml"
exit 1
fi
- name: Generate CRDs file
run: |
make kustomize
./bin/kustomize build ./config/crd > crds.yaml
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
Expand Down Expand Up @@ -78,11 +82,11 @@ jobs:
- id: prerelease
run: |
if echo "${{ github.ref_name }}" |egrep -q "^[0-9]+.[0-9]+.[0-9]+$"; then
echo "::set-output name=prerelease::false"
echo "prerelease=false" >> $GITHUB_OUTPUT
else
echo "::set-output name=prerelease::true"
echo "prerelease=true" >> $GITHUB_OUTPUT
fi
- uses: softprops/action-gh-release@v1
- uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.GIT_TAG }}
prerelease: ${{ steps.prerelease.outputs.prerelease }}
Expand All @@ -96,3 +100,5 @@ jobs:
token: ${{ secrets.CI_GIT_TOKEN }}
name: EMQX Operator ${{ github.ref_name }} Released
body_path: RELEASE.md
files: |
crds.yaml
8 changes: 4 additions & 4 deletions scripts/gen-helm-crds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ popd
while IFS= read -r -d '' file
do
if yq '.metadata.annotations' "$file" | yq 'keys' | grep -q 'cert-manager.io/inject-ca-from' > /dev/null 2>&1 ; then
yq -i '.metadata.annotations."cert-manager.io/inject-ca-from" = "{{ .Release.Namespace }}/{{ include \"emqx-operator.fullname\" . }}-serving-cert"' "$file"
yq -i '.spec.conversion.webhook.clientConfig.service.name= "{{ include \"emqx-operator.fullname\" . }}-webhook-service"' "$file"
yq -i '.spec.conversion.webhook.clientConfig.service.namespace = "{{ .Release.Namespace }}"' "$file"
fi
yq -i '.metadata.annotations."cert-manager.io/inject-ca-from" = "{{ .Release.Namespace }}/{{ include \"emqx-operator.fullname\" . }}-serving-cert"' "$file"
yq -i '.spec.conversion.webhook.clientConfig.service.name= "{{ include \"emqx-operator.fullname\" . }}-webhook-service"' "$file"
yq -i '.spec.conversion.webhook.clientConfig.service.namespace = "{{ .Release.Namespace }}"' "$file"
fi

sed -i '1i {{- if not .Values.skipCRDs }}\n' "$file"
echo -e '\n{{- end }}' >> "$file"
Expand Down

0 comments on commit 4e91eb5

Please sign in to comment.