From 3a272a20b34bd71136849f9e006864314c4607ba Mon Sep 17 00:00:00 2001 From: scx1332 Date: Fri, 21 Jun 2024 14:01:48 +0200 Subject: [PATCH] Test build nightly --- .github/workflows/build_nigthly.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/build_nigthly.yml b/.github/workflows/build_nigthly.yml index 3137cb71..f41ad3d8 100644 --- a/.github/workflows/build_nigthly.yml +++ b/.github/workflows/build_nigthly.yml @@ -23,6 +23,25 @@ jobs: VERSION=$(grep '^version =' Cargo.toml | cut -d '"' -f2) echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + - name: Delete release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TAG_NAME=v${{ steps.get_version.outputs.VERSION }}-nightly + RELEASE_ID=$(curl -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG_NAME \ + | jq -r '.id') + + if [ "$RELEASE_ID" != "null" ]; then + curl -X DELETE -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID + echo "Release deleted" + else + echo "Release not found" + fi + - name: Create and push tag run: | echo "Created tag: v${{ steps.get_version.outputs.VERSION }}"