diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 71fecb733..2c671d71b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 }} @@ -96,3 +100,5 @@ jobs: token: ${{ secrets.CI_GIT_TOKEN }} name: EMQX Operator ${{ github.ref_name }} Released body_path: RELEASE.md + files: | + crds.yaml diff --git a/scripts/gen-helm-crds.sh b/scripts/gen-helm-crds.sh index 52fd102ff..4252ef335 100755 --- a/scripts/gen-helm-crds.sh +++ b/scripts/gen-helm-crds.sh @@ -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"