diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7152708..ee47ce9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,19 @@ jobs: runs-on: windows-latest steps: + - name: Install curl on Windows + run: | + choco install curl + + - name: Delete existing draft release + run: | + $releaseId = (curl -s -H "Authorization: Bearer $env:GITHUB_TOKEN" ` + "https://api.github.com/repos/${env:GITHUB_REPOSITORY}/releases/tags/${{ steps.gen_release_title.outputs.version }}" | ConvertFrom-Json).id + if ($releaseId -ne $null) { + curl -X DELETE -H "Authorization: Bearer $env:GITHUB_TOKEN" ` + "https://api.github.com/repos/${env:GITHUB_REPOSITORY}/releases/$releaseId" + } + - name: Generate release title id: gen_release_title run: |