File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed
Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -175,4 +175,4 @@ jobs:
175175 target_commitish : ${{ github.sha }}
176176 prerelease : ${{ needs.prepare.outputs.is-prerelease == 'true' }}
177177 draft : false
178- body : ${{ steps.cliff .outputs.content }}
178+ body : ${{ steps.changelog .outputs.content }}
Original file line number Diff line number Diff line change @@ -249,10 +249,31 @@ VERSION ?=
249249GITHUB_TOKEN ?=
250250
251251.PHONY : release
252- release : # # Create a new release.
253- @if [ -z " $( VERSION) " ]; then \
254- echo " ERROR: VERSION is required. Usage: make release VERSION=X.Y.Z GITHUB_TOKEN=<token> " ; \
252+ release : # # Create a new release and generate changelog .
253+ @if [ -z " $( VERSION) " ] || ! echo " $( VERSION ) " | grep -E -q ' ^[0-9]+\.[0-9]+\.[0-9]+$$ ' ; then \
254+ echo " ERROR: VERSION must be set in X.Y.Z format. Usage: make release VERSION=X.Y.Z" ; \
255255 exit 1; \
256256 fi
257+
258+ @if [ -z "$(GITHUB_TOKEN)" ]; then \
259+ echo "ERROR: GITHUB_TOKEN is required. Usage: make release VERSION=X.Y.Z GITHUB_TOKEN=<token>"; \
260+ exit 1; \
261+ fi
262+
263+ @echo "Fetching upstream tags..."
264+ @git fetch --tags https://github.com/kubeflow/trainer.git
265+
266+ @echo "Generating changelog for v$(VERSION)..."
267+ @if ! git-cliff --unreleased --tag "v$(VERSION)" --prepend CHANGELOG.md; then \
268+ echo ""; \
269+ echo "ERROR: git-cliff failed."; \
270+ echo "Ensure git-cliff is installed and GITHUB_TOKEN is valid."; \
271+ exit 1; \
272+ fi
273+
274+ @echo "Running release script..."
257275 @export GITHUB_TOKEN=$(GITHUB_TOKEN); \
258276 ./hack/release.sh $(VERSION)
277+
278+ @echo ""
279+ @echo "✅ Release v$(VERSION) prepared successfully."
You can’t perform that action at this time.
0 commit comments