Nightly #71
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly | |
on: | |
schedule: | |
# 00:00 UTC+8 -> 16:00 | |
- cron: "0 16 * * *" | |
workflow_dispatch: | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: trigger | |
env: | |
GH_TOKEN: ${{ secrets.NIGHTLY_TOKEN }} | |
TZ: Asia/Shanghai | |
run: | | |
commit_date=$(git log -1 --since="24 hours ago" --pretty=format:"%cI") | |
if [[ -n "$commit_date" ]]; then | |
if gh release view v0.0.0-nightly --json name; then | |
gh release edit v0.0.0-nightly --target $(git log --format="%H" -n 1) --title "nightly in $(date --rfc-3339=date)" | |
else | |
gh release create v0.0.0-nightly --generate-notes --prerelease | |
fi | |
fi |