-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (32 loc) · 1.51 KB
/
nightly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Nightly Release Management
on:
push:
branches:
- master
jobs:
manage-nightly:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Manage Nightly Release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
# Delete the previous nightly release if it exists
gh release delete nightly --yes || true
# Delete the previous nightly tag if it exists
git tag -d nightly || true
git push origin :refs/tags/nightly || true
# Wait briefly to avoid lock issues
sleep 5
# Fetch the latest changes and tags from the repository
git fetch origin
# Create a new nightly tag pointing to the latest commit on master
LATEST_COMMIT=$(git rev-parse origin/master)
git tag nightly $LATEST_COMMIT
git push origin nightly
# Ensure the tag is fully pushed and recognized by GitHub
sleep 5
# Create a new nightly release, explicitly targeting the latest commit
gh release create nightly --notes "Nightly build based on master branch" --title "nightly" --target $LATEST_COMMIT --prerelease