build: do delete and create in one step

This commit is contained in:
Kilian von Pflugk 2024-05-27 19:46:45 +02:00
parent 977913ffc8
commit 965f5100ee

View File

@ -78,21 +78,10 @@ jobs:
checksum="$(awk '{print $1}' intro-skipper-${{ env.GIT_HASH }}.md5)" checksum="$(awk '{print $1}' intro-skipper-${{ env.GIT_HASH }}.md5)"
echo "CHECKSUM=$checksum" >> $GITHUB_ENV 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' if: github.event_name != 'pull_request'
run: | run: |
if gh release view 10.9/preview --json id 2>/dev/null; then gh release delete '10.9/preview' --cleanup-tag --yes || true
release_id=$(gh release view 10.9/preview --json id -q ".id") 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."
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
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 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 }}