From 089ad832b9b44adf396bf99b4052ba91c30ba5e8 Mon Sep 17 00:00:00 2001 From: Ylarod Date: Thu, 20 Jul 2023 11:13:54 +0800 Subject: [PATCH] update ci --- .github/workflows/build.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d8cd711..57863de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,7 +58,11 @@ jobs: data: { tag_name: ver } } = releaseResponse; if (ver == '${{ steps.pullFridaLatestRelease.outputs.FRIDA_VERSION }}'){ - core.setOutput('ALREADY_RELEASE', '1'); + if ( ${{ ( github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}){ + core.setOutput('ALREADY_RELEASE', '2'); + } else { + core.setOutput('ALREADY_RELEASE', '1'); + } } else{ core.setOutput('ALREADY_RELEASE', '0'); @@ -71,11 +75,19 @@ jobs: core.setFailed(e.message); } } + + - name: Delete release + if: ${{ steps.checkReleaseVersion.outputs.ALREADY_RELEASE == '2' }} + uses: dev-drprasad/delete-tag-and-release@v1.0 + with: + tag_name: ${{ steps.pullFridaLatestRelease.outputs.FRIDA_VERSION }} + github_token: ${{ secrets.GITHUB_TOKEN }} + delete_release: true create_release: needs: check_version runs-on: ubuntu-22.04 - if: needs.check_version.outputs.ALREADY_RELEASE == '0' + if: needs.check_version.outputs.ALREADY_RELEASE != '1' steps: - uses: actions/create-release@master