Files
aeqw89.tools.Publish/.gitea/workflows/build_releases.yaml
T
qwsdcvghyu89 c4ad861621
Nightly Build and Release / Build and Release Nightly (push) Successful in 31s
Fixed cleanup step
2026-06-05 03:52:47 +10:00

63 lines
2.3 KiB
YAML

name: Nightly Build and Release
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build-releases:
name: 'Build and Release Nightly'
runs-on: Debian-x86
permissions:
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup .NET 11.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: '11.0.100-preview.4.26230.115'
# Authenticate with your private Gitea NuGet registry
- name: Add Gitea NuGet Source
run: |
dotnet nuget remove source "GiteaRegistry" || true
dotnet nuget add source "https://git.main.qwsdcvghyu.com/api/packages/riley/nuget/index.json" --name "GiteaRegistry" --username "riley" --password "${{ secrets.PACKAGES_KEY }}" --store-password-in-clear-text
- name: 'Execute .NET Publish Target'
run: dotnet build aeqw89.tools.Publish/aeqw89.tools.Publish.csproj -p:ArchiveVersion=nightly -t:Archive
# 1. Clean the release database and forcefully advance the tag
- name: Clean up Release & Update Tag
run: |
# 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')
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
fi
# 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`.
**Commit:** ${{ github.sha }}
prerelease: true
files: |
aeqw89.tools.Publish/dist/*.zip
aeqw89.tools.Publish/dist/*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}