This commit is contained in:
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user