From 494bc149ee1caf62fbf014027108f3baf6dcaf46 Mon Sep 17 00:00:00 2001 From: Milad Raeisi Date: Sun, 29 Sep 2024 07:22:31 +0400 Subject: [PATCH] Update release.yml --- .github/workflows/release.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b4e846ff..2e2b8b5e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,9 +71,13 @@ jobs: name: ${{ env.PROJECT_NAME }}-preview-${{ env.VERSION }} path: ${{ env.RELEASE_NAME }} - # Step 10: Create/Update GitHub Release using GitHub CLI - - name: Create GitHub Release + # Step 10: Create or Update GitHub Release + - name: Create or Update GitHub Release run: | - gh release create ${{ env.VERSION }} ${{ env.RELEASE_NAME }} --title "${{ env.PROJECT_NAME }} v${{ env.VERSION }}" --draft --notes "Auto-generated release for version ${{ env.VERSION }}" + if gh release view ${{ env.VERSION }}; then + gh release upload ${{ env.VERSION }} ${{ env.RELEASE_NAME }} --clobber + else + gh release create ${{ env.VERSION }} ${{ env.RELEASE_NAME }} --title "${{ env.PROJECT_NAME }} v${{ env.VERSION }}" --draft --notes "Auto-generated release for version ${{ env.VERSION }}" + fi env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}