Skip to content

Commit fa2b4f4

Browse files
authored
Add installation manifest artifact to GitHub releases (#4)
1 parent cb24e92 commit fa2b4f4

4 files changed

Lines changed: 27 additions & 3 deletions

File tree

.github/workflows/manage-release-tags.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,4 @@ jobs:
114114
git push origin "$NEW_TAG"
115115
116116
echo "Successfully created and pushed tag $NEW_TAG"
117-
done
117+
done

.github/workflows/multiarch-build-and-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ jobs:
6464
push: true
6565
tags: |
6666
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:main
67-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version_tag }}
67+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version_tag }}

.github/workflows/release.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,25 @@ jobs:
9494
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.major_minor }}
9595
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.major }}
9696
97+
- name: Set up Go
98+
uses: actions/setup-go@v5
99+
with:
100+
go-version-file: 'go.mod'
101+
102+
- name: Generate installation manifest
103+
run: |
104+
GIT_SHA=$(git rev-parse --short HEAD)
105+
make build-installer \
106+
IMG=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.full }} \
107+
VERSION_LABEL=${{ steps.version.outputs.full }} \
108+
GIT_SHA_LABEL=${GIT_SHA}
109+
mv dist/install.yaml func-operator.yaml
110+
97111
- name: Create GitHub Release
98112
env:
99113
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100114
run: |
101115
gh release create ${{ github.ref_name }} \
102116
--title "Release ${{ github.ref_name }}" \
103-
--generate-notes
117+
--generate-notes \
118+
func-operator.yaml

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,16 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform
209209
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
210210
mkdir -p dist
211211
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
212+
@if [ -n "$(VERSION_LABEL)" ]; then \
213+
cd config/default && $(KUSTOMIZE) edit add label app.kubernetes.io/version:$(VERSION_LABEL) --force; \
214+
fi
215+
@if [ -n "$(GIT_SHA_LABEL)" ]; then \
216+
cd config/default && $(KUSTOMIZE) edit add label app.kubernetes.io/commit:$(GIT_SHA_LABEL) --force; \
217+
fi
212218
$(KUSTOMIZE) build config/default > dist/install.yaml
219+
@if [ -n "$(VERSION_LABEL)" ] || [ -n "$(GIT_SHA_LABEL)" ]; then \
220+
cd config/default && git restore kustomization.yaml; \
221+
fi
213222

214223
##@ Deployment
215224

0 commit comments

Comments
 (0)