From 965f5100ee79a6e019f578613c802c477a7cac57 Mon Sep 17 00:00:00 2001 From: Kilian von Pflugk Date: Mon, 27 May 2024 19:46:45 +0200 Subject: [PATCH] build: do delete and create in one step --- .github/workflows/build.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ba7d19..0e50dcd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,21 +78,10 @@ jobs: checksum="$(awk '{print $1}' intro-skipper-${{ env.GIT_HASH }}.md5)" echo "CHECKSUM=$checksum" >> $GITHUB_ENV - - name: Check if prerelease with tag '10.9/preview' exists and delete it + - name: Create/replace the preview release and upload artifacts if: github.event_name != 'pull_request' run: | - if gh release view 10.9/preview --json id 2>/dev/null; then - release_id=$(gh release view 10.9/preview --json id -q ".id") - echo "Deleting existing prerelease with id: $release_id" - gh release delete 10.9/preview -y - else - echo "No existing prerelease with tag '10.9/preview' found." - fi + gh release delete '10.9/preview' --cleanup-tag --yes || true + gh release create '10.9/preview' "intro-skipper-${{ env.GIT_HASH }}.zip" --prerelease --title "intro-skipper-${{ env.GIT_HASH }}" --notes "This is a prerelease version." env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Create new prerelease with tag '10.9/preview' - if: github.event_name != 'pull_request' - run: gh release create 10.9/preview "intro-skipper-${{ env.GIT_HASH }}.zip" --prerelease --title "intro-skipper-${{ env.GIT_HASH }}" --notes "This is a prerelease version." - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file