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 <[email protected]>
  • Loading branch information
Rory-Z committed Jan 13, 2025
1 parent 2f4089d commit 3d2e8f2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 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
4 changes: 2 additions & 2 deletions deploy/charts/emqx-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.2.26
version: 2.2.27

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 2.2.26
appVersion: 2.2.27

sources:
- https://github.com/emqx/emqx-operator/tree/main/deploy/charts/emqx-operator
Expand Down
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 3d2e8f2

Please sign in to comment.