From d1bf59b33b3c5fb2d2d1d9e64e05881446042e61 Mon Sep 17 00:00:00 2001 From: niklascfw Date: Mon, 13 Apr 2026 18:59:24 +0200 Subject: [PATCH] CI: single nightly release (nightly tag) instead of per-push dev tags Made-with: Cursor --- .github/workflows/build-and-release.yml | 50 +++++++++++++++++-------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index e3483cb..84f6969 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -3,6 +3,10 @@ name: Build and Release on: push: +concurrency: + group: nightly-release-${{ github.repository }} + cancel-in-progress: true + jobs: build-and-release: runs-on: ubuntu-latest @@ -22,19 +26,35 @@ jobs: - name: Build zip package run: make zip - - name: Get version - id: version - run: echo "tag_name=dev-$(date +'%Y%m%d-%H%M%S')-${GITHUB_SHA::8}" >> $GITHUB_OUTPUT + - name: Nightly release (single tag, updated in place) + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -euo pipefail + TAG=nightly + ZIP="./output/OmniNX Downloader.zip" + REPO="${{ github.repository }}" + SHA="${{ github.sha }}" + REF="${{ github.ref_name }}" - - name: Create dev release - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ steps.version.outputs.tag_name }} - name: Release ${{ steps.version.outputs.tag_name }} - body: | - Automated dev build of OmniNX Downloader - Commit: ${{ github.sha }} - Branch: ${{ github.ref_name }} - draft: false - prerelease: true - files: ./output/OmniNX Downloader.zip + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git tag -f "$TAG" + git push origin "refs/tags/$TAG" --force + + NOTES="Single nightly build artifact (updated every push). + + **Commit:** \`${SHA}\` + **Branch:** \`${REF}\` + **Built:** $(date -u '+%Y-%m-%d %H:%M:%S UTC')" + + if gh release view "$TAG" --repo "$REPO" >/dev/null 2>&1; then + gh release upload "$TAG" "$ZIP" --clobber --repo "$REPO" + gh release edit "$TAG" --title "Nightly" --notes "$NOTES" --prerelease --repo "$REPO" + else + gh release create "$TAG" "$ZIP" \ + --title "Nightly" \ + --notes "$NOTES" \ + --prerelease \ + --repo "$REPO" + fi