CI: single nightly release (nightly tag) instead of per-push dev tags
Some checks failed
Build and Release / build-and-release (push) Failing after 1s
Some checks failed
Build and Release / build-and-release (push) Failing after 1s
Made-with: Cursor
This commit is contained in:
50
.github/workflows/build-and-release.yml
vendored
50
.github/workflows/build-and-release.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user