diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 397aea352..af55da253 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -53,4 +53,18 @@ jobs: git remote set-url origin https://x-access-token:${{ secrets.DAPR_BOT_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git # Copy first to allow automation to use the latest version and not the release branch's version. cp -R ./.github/scripts ${RUNNER_TEMP}/ - ${RUNNER_TEMP}/scripts/create-release.sh ${{ inputs.rel_version }} \ No newline at end of file + ${RUNNER_TEMP}/scripts/create-release.sh ${{ inputs.rel_version }} + - name: Create GitHub Release with auto-generated notes + if: ${{ !endsWith(inputs.rel_version, '-SNAPSHOT') && !contains(inputs.rel_version, '-rc-') }} + env: + GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }} + REL_VERSION: ${{ inputs.rel_version }} + run: | + # Normalize release version by stripping an optional leading 'v' + REL_VERSION="${REL_VERSION#v}" + TAG="v${REL_VERSION}" + if gh release view "${TAG}" >/dev/null 2>&1; then + echo "Release ${TAG} already exists, skipping creation." + else + gh release create "${TAG}" --generate-notes + fi \ No newline at end of file