From c4ad861621a3a8b09fbc2bfaa0e9376ebf0eebc1 Mon Sep 17 00:00:00 2001 From: qwsdcvghyu89 <61093706+qwsdcvghyu89@users.noreply.github.com> Date: Fri, 5 Jun 2026 03:52:47 +1000 Subject: [PATCH] Fixed cleanup step --- .gitea/workflows/build_releases.yaml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/build_releases.yaml b/.gitea/workflows/build_releases.yaml index 1317d84..bd9955c 100644 --- a/.gitea/workflows/build_releases.yaml +++ b/.gitea/workflows/build_releases.yaml @@ -31,26 +31,25 @@ jobs: - name: 'Execute .NET Publish Target' run: dotnet build aeqw89.tools.Publish/aeqw89.tools.Publish.csproj -p:ArchiveVersion=nightly -t:Archive - - name: Clean up previous Nightly Release + # 1. Clean the release database and forcefully advance the tag + - name: Clean up Release & Update Tag run: | - # 1. Ask the Gitea API for the release (jq makes extracting the ID perfectly safe) + # Find and delete the old Gitea Release payload via API RELEASE_ID=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" ${{ github.api_url }}/repos/${{ github.repository }}/releases/tags/nightly | jq -r '.id') - - # 2. If jq finds a valid ID, delete it if [ "$RELEASE_ID" != "null" ] && [ -n "$RELEASE_ID" ]; then echo "Deleting old release ID: $RELEASE_ID" curl -s -X DELETE -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" ${{ github.api_url }}/repos/${{ github.repository }}/releases/$RELEASE_ID - else - echo "No existing nightly release found to delete." fi - # 3. Delete the Git tag - git push --delete origin nightly || true + # Force the 'nightly' Git tag to point to this new commit and push it + git tag -f nightly ${{ github.sha }} + git push -f origin nightly - name: Update Nightly Release uses: softprops/action-gh-release@v2 with: tag_name: nightly + target_commitish: ${{ github.sha }} name: "Nightly Development Build" body: | Automated rolling nightly build from the latest commit on `main`.