From ddbc69737a293bef0a48f17ed5960c5cb63cf8bf Mon Sep 17 00:00:00 2001 From: sinspired Date: Wed, 16 Oct 2024 21:09:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_release.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index a6664a0..4a0e40d 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -102,17 +102,23 @@ jobs: echo "commit_message=${COMMIT_MESSAGE}" >> $GITHUB_OUTPUT shell: bash - - name: Delete existing release - uses: dev-drprasad/delete-tag-and-release@v0.2.1 - with: - tag_name: ${{ github.ref_name }} - delete_release: true + - name: Check existing release + id: check_release + run: | + if gh release view ${{ github.ref_name }} &> /dev/null; then + echo "release_exists=true" >> $GITHUB_OUTPUT + else + echo "release_exists=false" >> $GITHUB_OUTPUT + fi env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: List Files - run: ls -R ./ - shell: bash + - name: Delete existing release + if: steps.check_release.outputs.release_exists == 'true' + run: | + gh release delete ${{ github.ref_name }} --yes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create Release env: @@ -125,7 +131,7 @@ jobs: Changes in this release: ${{ steps.commit_message.outputs.commit_message }}" \ --draft=false \ - **/cnNetTool-Linux-x64.zip - **/cnNetTool-Windows-x64.zip + **/cnNetTool-Linux-x64.zip \ + **/cnNetTool-Windows-x64.zip \ **/cnNetTool-macOS-x64.zip shell: bash \ No newline at end of file