fix: show correct link for nightly #5
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 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 |