Skip to content

Commit

Permalink
release: Publish main branch images and charts (#10540)
Browse files Browse the repository at this point in the history
Signed-off-by: timflannagan <[email protected]>
  • Loading branch information
timflannagan authored Jan 30, 2025
1 parent 2e2dd9e commit 10baa94
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 7 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
tags:
- 'v*'
- '!v0.0.0-main'
branches:
- main
pull_request:
branches:
- main
Expand All @@ -30,7 +33,7 @@ jobs:
- name: Set the release related variables
id: set_vars
run: |
GIT_TAG=$(git describe --tags --abbrev=0)
GIT_TAG=$(git describe --tags --abbrev=0 --always)
GIT_SHA=$(git rev-parse --short HEAD)
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD | sed -e "s/\//-/g")
Expand All @@ -41,6 +44,9 @@ jobs:
elif [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION="${GITHUB_REF#refs/tags/}"
echo "goreleaser_args=--clean" >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/main ]]; then
VERSION="v0.0.0-main"
echo "goreleaser_args=--clean --skip=validate" >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/pull/* ]]; then
PR_NUM=$(echo "${GITHUB_REF}" | sed -E 's|refs/pull/([^/]+)/?.*|\1|')
VERSION="${GIT_TAG}-pr.${PR_NUM}-${GIT_SHA}"
Expand Down Expand Up @@ -108,3 +114,4 @@ jobs:
VERSION: ${{ needs.setup.outputs.version }}
IMAGE_REGISTRY: ${{ env.IMAGE_REGISTRY }}
GORELEASER_ARGS: ${{ needs.setup.outputs.goreleaser_args }}
GORELEASER_CURRENT_TAG: ${{ needs.setup.outputs.version }}
56 changes: 55 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,61 @@ docker_manifests:
- *envoyinit_arm_image
- *envoyinit_amd_image
changelog:
disable: false
disable: true
release:
prerelease: "auto"
mode: "replace"
replace_existing_artifacts: true
header: |
{{ if eq .Env.VERSION "v0.0.0-main" }}
🚀 Nightly build of kgateway!
---
It includes the latest changes but may be unstable. Use it for testing and providing feedback.
{{ else }}
🎉 Welcome to the {{ .Env.VERSION }} release of the kgateway project!
---
{{ end }}
footer: |
## Installation
The kgateway project is available as a Helm chart and docker images.
### Helm Charts
The Helm chart is available at {{ .Env.IMAGE_REGISTRY }}/charts/kgateway.
### Docker Images
The docker images are available at:
- {{ .Env.IMAGE_REGISTRY }}:{{ .Env.CONTROLLER_IMAGE_REPO }}:{{ .Env.VERSION }}
- {{ .Env.IMAGE_REGISTRY }}:{{ .Env.SDS_IMAGE_REPO }}:{{ .Env.VERSION }}
- {{ .Env.IMAGE_REGISTRY }}:{{ .Env.ENVOYINIT_IMAGE_REPO }}:{{ .Env.VERSION }}
## Quickstart
First, create a [kind cluster](https://kind.sigs.k8s.io/docs/user/quick-start/#installation).
```bash
kind create cluster
```
Then, deploy the Kubernetes Gateway API CRDs.
```bash
kubectl apply --kustomize "https://github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v1.2.1"
```
Install the `kgateway` controller.
```bash
helm install --create-namespace --namespace kgateway-system --version {{ .Env.VERSION }} kgateway oci://{{ .Env.IMAGE_REGISTRY }}/charts/kgateway
```
Verify the release was successful.
```bash
kubectl get pods -n kgateway-system
```
If the release was successful, you should see a `kgateway` pod running.
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,11 @@ view-test-coverage:
go tool cover -html $(OUTPUT_DIR)/cover.out

.PHONY: package-kgateway-chart
HELM_PACKAGE_ARGS ?= --version $(VERSION)
package-kgateway-chart: ## Package the new kgateway helm chart for testing
mkdir -p $(TEST_ASSET_DIR)
helm package --version $(VERSION) --destination $(TEST_ASSET_DIR) install/helm/kgateway
helm repo index $(TEST_ASSET_DIR)
mkdir -p $(TEST_ASSET_DIR); \
helm package $(HELM_PACKAGE_ARGS) --destination $(TEST_ASSET_DIR) install/helm/kgateway; \
helm repo index $(TEST_ASSET_DIR);

#----------------------------------------------------------------------------------
# Clean
Expand Down Expand Up @@ -583,11 +584,12 @@ publish-docker: docker docker-push

endif # Publish Artifact Targets

GORELEASER_ARGS ?= --snapshot --clean
GORELEASER ?= go run github.com/goreleaser/goreleaser/[email protected]
GORELEASER_ARGS ?= --snapshot --clean
GORELEASER_CURRENT_TAG ?= $(VERSION)
.PHONY: release
release: ## Create a release using goreleaser
$(GORELEASER) release $(GORELEASER_ARGS)
GORELEASER_CURRENT_TAG=$(GORELEASER_CURRENT_TAG) $(GORELEASER) release $(GORELEASER_ARGS)

#----------------------------------------------------------------------------------
# Docker
Expand Down

0 comments on commit 10baa94

Please sign in to comment.