diff --git a/.github/workflows/ci-release.yaml b/.github/workflows/ci-release.yaml index 3391c04824..fa914f946f 100644 --- a/.github/workflows/ci-release.yaml +++ b/.github/workflows/ci-release.yaml @@ -51,3 +51,43 @@ jobs: tag: ${{ needs.set-params.outputs.tag }} prerelease: ${{ fromJSON(needs.set-params.outputs.prerelease) }} chart-suffix: "" + + upload-artifacts: + needs: set-params + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout source + uses: actions/checkout@v6 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Setup Kubectl + uses: azure/setup-kubectl@v4 + with: + version: 'latest' + + - name: Build Artifacts + run: | + make artifacts + + - name: Upload Release Assets + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + files=$(find artifacts -type f -size +0c | tr '\n' ' ') + if [ -z "$files" ]; then + echo "No artifacts to upload." + exit 0 + fi + if gh release view "${{ needs.set-params.outputs.tag }}" >/dev/null 2>&1; then + gh release upload "${{ needs.set-params.outputs.tag }}" $files --clobber + else + echo "Release ${{ needs.set-params.outputs.tag }} does not exist. Creating a draft release..." + gh release create "${{ needs.set-params.outputs.tag }}" $files --draft --title "${{ needs.set-params.outputs.tag }}" --notes "Release ${{ needs.set-params.outputs.tag }}" + fi + diff --git a/Makefile b/Makefile index 6a8b893654..71cf061a26 100644 --- a/Makefile +++ b/Makefile @@ -360,6 +360,19 @@ helm-push-standalone: ## Package and push the llm-d-router-standalone Helm chart $(MAKE) helm-push CHART=llm-d-router-standalone +##@ Release + +.PHONY: artifacts +artifacts: yq check-kustomize ## Generate release artifacts (CRD manifests) + if [ -d artifacts ]; then rm -rf artifacts; fi + mkdir -p artifacts + kubectl kustomize config/crd > artifacts/manifests_all.yaml + $(YQ) -P 'select(.spec.group == "llm-d.ai")' artifacts/manifests_all.yaml > artifacts/manifests.yaml + rm -f artifacts/manifests_all.yaml + $(YQ) -P 'select(.spec.versions | map(.name == "v1") | any)' artifacts/manifests.yaml > artifacts/v1-manifests.yaml + $(YQ) -P 'select(.spec.versions | map(.name != "v1") | all)' artifacts/manifests.yaml > artifacts/experimental-manifests.yaml + + ##@ Coverage COVERAGE_DIR ?= coverage