Some checks failed
Build and Release / build-and-release (push) Failing after 1s
Made-with: Cursor
61 lines
1.6 KiB
YAML
61 lines
1.6 KiB
YAML
name: Build and Release
|
|
|
|
on:
|
|
push:
|
|
|
|
concurrency:
|
|
group: nightly-release-${{ github.repository }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-and-release:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up build tools
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y zip rsync
|
|
|
|
- name: Build zip package
|
|
run: make zip
|
|
|
|
- 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 }}"
|
|
|
|
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
|