Unverified Commit 212fd278 authored by Muyang Li's avatar Muyang Li Committed by GitHub
Browse files

chore: add nightly linux wheel build (#395)

* revise the tag name

* build all linux wheels

* add the cleaning ci
parent cb1b9231
#name: Clean Nightly Releases
#
#on:
name: Clean Nightly Releases
on:
# schedule:
# - cron: '0 4 * * *' # Runs daily at 04:00 UTC
# workflow_dispatch: # Allows manual triggering
#
#jobs:
# clean-nightly:
# runs-on: ubuntu-latest
# permissions:
# contents: write
# packages: write
#
# steps:
# - name: Set up GitHub CLI
# uses: cli/cli-action@v2
#
# - name: Authenticate GitHub CLI
# run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
#
# - name: Get and clean old nightly releases
# env:
# GH_REPO: ${{ github.repository }}
# run: |
# # Get all release titles that match the nightly pattern
# mapfile -t releases < <(
# gh release list --limit 1000 --json tagName,name,createdAt --jq '
# sort_by(.createdAt) | reverse |
# map(select(.name | test("^Nunchaku Nightly v[0-9]+\\.[0-9]+\\.[0-9]+dev[0-9]{8}$"))) |
# map(.tagName)'
# )
#
# # Keep only the first 5 (latest), delete the rest
# if (( ${#releases[@]} > 5 )); then
# for tag in "${releases[@]:5}"; do
# echo "Deleting old release: $tag"
# gh release delete "$tag" --yes
# done
# else
# echo "Less than or equal to 5 nightly releases found. No cleanup needed."
# fi
# - cron: '0 3 * * *' # Runs daily at 03:00 UTC
workflow_dispatch: # Allows manual triggering
jobs:
clean-nightly:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Set up GitHub CLI
uses: cli/cli-action@v2
- name: Authenticate GitHub CLI
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
- name: Get and clean old nightly releases
env:
GH_REPO: ${{ github.repository }}
run: |
# Get all release titles that match the nightly pattern
mapfile -t releases < <(
gh release list --limit 1000 --json tagName,name,createdAt --jq '
sort_by(.createdAt) | reverse |
map(select(.name | test("^Nunchaku Nightly v[0-9]+\\.[0-9]+\\.[0-9]+dev[0-9]{8}$"))) |
map(.tagName)'
)
# Keep only the first 5 (latest), delete the rest
if (( ${#releases[@]} > 5 )); then
for tag in "${releases[@]:5}"; do
echo "Deleting old release: $tag"
gh release delete "$tag" --yes
done
else
echo "Less than or equal to 5 nightly releases found. No cleanup needed."
fi
......@@ -44,7 +44,7 @@ jobs:
if: steps.check.outputs.is_dev == 'true'
run: |
today=$(date -u +"%Y%m%d")
tag_name="v${{ steps.version.outputs.version }}-$today"
tag_name="v${{ steps.version.outputs.version }}$today"
echo "tag_name=$tag_name"
echo "tag_name=$tag_name" >> "$GITHUB_OUTPUT"
......@@ -78,7 +78,7 @@ jobs:
- name: Build wheels
run: |
bash scripts/build_linux_wheel.sh "3.10" "2.7" "12.8"
bash scripts/build_all_linux_wheels.sh
- name: Upload wheels to GitHub Release
uses: softprops/action-gh-release@v2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment