Skip to content

Commit 72b71a3

Browse files
committed
ci: add artifacts target and upload-artifacts job for CRDs
Signed-off-by: Cong Liu <conliu@google.com>
1 parent 3b9d93b commit 72b71a3

4 files changed

Lines changed: 53 additions & 2 deletions

File tree

.github/workflows/ci-release.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,38 @@ jobs:
5151
tag: ${{ needs.set-params.outputs.tag }}
5252
prerelease: ${{ fromJSON(needs.set-params.outputs.prerelease) }}
5353
chart-suffix: ""
54+
55+
upload-artifacts:
56+
needs: set-params
57+
runs-on: ubuntu-latest
58+
permissions:
59+
contents: write
60+
steps:
61+
- name: Checkout source
62+
uses: actions/checkout@v6
63+
64+
- name: Set up Go
65+
uses: actions/setup-go@v5
66+
with:
67+
go-version-file: go.mod
68+
69+
- name: Build Artifacts
70+
run: |
71+
make artifacts
72+
73+
- name: Upload Release Assets
74+
env:
75+
GITHUB_TOKEN: ${{ github.token }}
76+
run: |
77+
files=$(find artifacts -type f -size +0c | tr '\n' ' ')
78+
if [ -z "$files" ]; then
79+
echo "No artifacts to upload."
80+
exit 0
81+
fi
82+
if gh release view "${{ needs.set-params.outputs.tag }}" >/dev/null 2>&1; then
83+
gh release upload "${{ needs.set-params.outputs.tag }}" $files --clobber
84+
else
85+
echo "Release ${{ needs.set-params.outputs.tag }} does not exist. Creating a draft release..."
86+
gh release create "${{ needs.set-params.outputs.tag }}" $files --draft --title "${{ needs.set-params.outputs.tag }}" --notes "Release ${{ needs.set-params.outputs.tag }}"
87+
fi
88+

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,17 @@ helm-push-standalone: ## Package and push the llm-d-router-standalone Helm chart
360360
$(MAKE) helm-push CHART=llm-d-router-standalone
361361

362362

363+
##@ Release
364+
365+
.PHONY: artifacts
366+
artifacts: yq ## Generate release artifacts (CRD manifests)
367+
if [ -d artifacts ]; then rm -rf artifacts; fi
368+
mkdir -p artifacts
369+
kubectl kustomize config/crd/bases -o artifacts/manifests.yaml
370+
$(YQ) -P 'select(.spec.versions[].name == "v1")' artifacts/manifests.yaml > artifacts/v1-manifests.yaml
371+
$(YQ) -P 'select(.spec.versions[].name != "v1")' artifacts/manifests.yaml > artifacts/experimental-manifests.yaml
372+
373+
363374
##@ Coverage
364375

365376
COVERAGE_DIR ?= coverage
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
resources:
5+
- llm-d.ai_inferenceobjectives.yaml
6+
- llm-d.ai_inferencemodelrewrites.yaml

config/crd/kustomization.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ kind: Kustomization
33

44
resources:
55
- ../../deploy/components/crds-gie
6-
- bases/llm-d.ai_inferenceobjectives.yaml
7-
- bases/llm-d.ai_inferencemodelrewrites.yaml
6+
- bases

0 commit comments

Comments
 (0)