Prune-Nightly #1285
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
# This workflow prunes the conda and pip nightly repo | |
# to remove old nightly builds (to keep the storage cost minimal). | |
# We also synchronize the wheel release page in the main website | |
# to list all the latest wheel uploded. | |
name: Prune-Nightly | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: '0 11 * * *' # 10 AM UTC | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Setup script env | |
run: | | |
mv conda/tvm-unity/build-environment.yaml 3rdparty/tlcpack/conda/build-environment.yaml | |
ln -s 3rdparty/tlcpack/conda tlc-conda | |
ln -s 3rdparty/tlcpack/docker docker | |
ln -s 3rdparty/tlcpack/common common | |
- uses: actions/cache@v1 | |
env: | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('tlc-conda/build-environment.yaml') }} | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: tlcpack-build | |
channel-priority: strict | |
environment-file: tlc-conda/build-environment.yaml | |
auto-activate-base: false | |
- name: Conda info | |
run: | | |
conda info | |
conda list | |
- name: Wheel-Site-Checkout | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.MLC_GITHUB_TOKEN }} | |
run: | | |
git clone https://[email protected]/mlc-ai/mlc-ai.github.io | |
cd mlc-ai.github.io | |
git config user.name mlc-bot | |
git config user.email [email protected] | |
cd .. | |
- name: Wheel-Prune-Sync | |
if: github.ref == 'refs/heads/main' | |
shell: bash -l {0} | |
env: | |
GITHUB_TOKEN: ${{ secrets.MLC_GITHUB_TOKEN }} | |
run: >- | |
python -m pip install pyOpenSSL --upgrade && | |
python -m pip install github3.py requests && | |
python scripts/wheel_prune_and_sync.py --site-path mlc-ai.github.io --repo mlc-ai/package |