This commit is contained in:
@@ -31,26 +31,25 @@ jobs:
|
|||||||
- name: 'Execute .NET Publish Target'
|
- name: 'Execute .NET Publish Target'
|
||||||
run: dotnet build aeqw89.tools.Publish/aeqw89.tools.Publish.csproj -p:ArchiveVersion=nightly -t:Archive
|
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: |
|
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')
|
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
|
if [ "$RELEASE_ID" != "null" ] && [ -n "$RELEASE_ID" ]; then
|
||||||
echo "Deleting old release ID: $RELEASE_ID"
|
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
|
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
|
fi
|
||||||
|
|
||||||
# 3. Delete the Git tag
|
# Force the 'nightly' Git tag to point to this new commit and push it
|
||||||
git push --delete origin nightly || true
|
git tag -f nightly ${{ github.sha }}
|
||||||
|
git push -f origin nightly
|
||||||
|
|
||||||
- name: Update Nightly Release
|
- name: Update Nightly Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: nightly
|
tag_name: nightly
|
||||||
|
target_commitish: ${{ github.sha }}
|
||||||
name: "Nightly Development Build"
|
name: "Nightly Development Build"
|
||||||
body: |
|
body: |
|
||||||
Automated rolling nightly build from the latest commit on `main`.
|
Automated rolling nightly build from the latest commit on `main`.
|
||||||
|
|||||||
Reference in New Issue
Block a user